Git Product home page Git Product logo

gulp-armapbo-plugin's Introduction

node npm Travis branch Coveralls branch Dependencies

Gulp Arma Pbo plugin

The plugin's goal is to create Arma2/Arma3 pbo files from sources using Gulp.

Installation

npm install gulp-armapbo

Usage

const gulp = require('gulp');
const pbo = require('gulp-armapbo');

gulp.task('pack', () => {
    return gulp.src('pbo-contents/**/*')
        .pipe(pbo.pack({
            fileName: 'my-file.pbo',
            extensions: [{
                name: 'author',
                value: 'Author Name'
            }, {
                name: 'mission',
                value: 'Mission Name'
            }],
            compress: [
                '**/*.sqf',
                'mission.sqm',
                'description.ext'
            ]
        }))
        .pipe(gulp.dest('pbo-packed/'));
});

Usage with TypeScript

import * as gulp from 'gulp';
import {pack, StreamOptions} from 'gulp-armapbo';

gulp.task('pack', () => {
    return gulp.src('pbo-contents/**/*')
        .pipe(pack({
            fileName: 'my-file.pbo',
            extensions: [{
                name: 'author',
                value: 'Author Name'
            }, {
                name: 'mission',
                value: 'Mission Name'
            }],
            compress: [
                '**/*.sqf',
                'mission.sqm',
                'description.ext'
            ]
        } as StreamOptions))
        .pipe(gulp.dest('pbo-packed/'));
});

Plugin API

pbo.pack([options])

Options

Required: no

options.fileName

Name of the pbo file to create, e.g. someFileName.pbo; if no value specified, the name of the $cwd is used

Type: string

Default: process.cwd()

Required: no

options.extensions

Adds pbo file header extension fields. You are free to place any arbitrary information here.

Type: array of {name:<string>, value:<string>} objects, e.g. {name: 'author', value: 'Author Name' }

Default: undefined

Required: no

options.compress

Files to apply data compression to

Type: string (glob pattern) or array of strings (glob patterns), e.g. compress: 'mission.sqm' or compress: '**/*.sqf' or compress: ['**/*.sqf', '**/*.hpp', 'mission.sqm']

Default: undefined

Required: no

options.verbose

Print compression information to console

Type: bool

Default: true

Required: no

options.progress

Print the current file compression progress to console

Type: bool

Default: true

Required: no

gulp-armapbo-plugin's People

Contributors

winseros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gulp-armapbo-plugin's Issues

Unpacking PBOs

Hi, does this support unpacking PBOs and if not, is there a possibility for it to be added?

Broken signatures

Hi!

I am signing a .pbo made by this tool. It seems like even though the .pbo is loaded in arma properly, and DSUtils shows no signature errors, arma fails to verify signatures somehow. To confirm, I have packed same folder with the default arma addon builder, then signed it, and it has no issues. Although it might be that I'm doing something wrong.

Cannot Read Property Length of Null

My gulpfile is as follows:

const gulp = require ('gulp');
const pbo = require ('gulp-armapbo');

gulp.task('pack', () => {
    return gulp.src('src/**')
        .pipe(pbo({
			progress: true,
			verbose: true
		}))
        .pipe(gulp.dest('./pbo-packed'));
});

I constantly get the same error, which is

            const entry = new headerEntry_1.HeaderEntry(file.relative, packingMethod, fileData.length, timeStamp);
                                                                                              ^

TypeError: Cannot read property 'length' of null
    at files.map.file (E:\GitLab\XenonLife-Updateomat\node_modules\gulp-armapbo\dist\core\pboBuilder.js:19:95)
    at Array.map (native)
    at PboBuilder.build (E:\GitLab\XenonLife-Updateomat\node_modules\gulp-armapbo\dist\core\pboBuilder.js:15:31)
    at PboTransformStream._flush (E:\GitLab\XenonLife-Updateomat\node_modules\gulp-armapbo\dist\core\pboTransformStream.js:23:36)
    at PboTransformStream.<anonymous> (_stream_transform.js:118:12)
    at Object.onceWrapper (events.js:291:19)
    at emitNone (events.js:86:13)
    at PboTransformStream.emit (events.js:186:7)
    at prefinish (_stream_writable.js:500:12)
    at finishMaybe (_stream_writable.js:508:7)

Output path inside PBO (linux only)

When used inside a linux container, the paths inside the PBO file are listed with '/' instead of ''.
For example:

folder/subfolder/file.sqf
instead of
folder\subfolder\file.sqf

Probably something related to path.sep. On a windows machine it works fine. Apparently Arma reads the PBO correctly. It just generates different output on windows and linux machines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.