GithubHelp home page GithubHelp logo

change build script about gulp-app HOT 5 CLOSED

sindresorhus avatar sindresorhus commented on July 28, 2024
change build script

from gulp-app.

Comments (5)

sindresorhus avatar sindresorhus commented on July 28, 2024

It's already using the local electron-packager. Those environment variables are set for you. All you need is to run npm run build.

from gulp-app.

zeakd avatar zeakd commented on July 28, 2024

I think it should be reopened.

  "scripts": {
    "start": "electron .",
    "build": "electron-packager . $npm_package_productName --prune --asar",
    "test": "xo"
  },

package.json the script start and build use globally installed electron and electron-packager, also even locally installed electron-packager can't execute that command because --platform=<platform> --arch=<arch> are required options in V7.0.3.

from gulp-app.

zeakd avatar zeakd commented on July 28, 2024

@sindresorhus. Now I know it use locally installed package, but here is the error.

> [email protected] build /Users/musicalapple/work/test/gulp-app/app
> electron-packager . $npm_package_productName --prune --asar

Usage: electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch>

Required options

sourcedir          the base directory of the application source

  Either both of:

platform           all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple)
arch               all, or one or more of: ia32, x64 (comma-delimited if multiple)

  Or:

all                equivalent to --platform=all --arch=all

  Examples:        electron-packager ./ --platform=darwin --arch=x64
                   electron-packager ./ --all

Optional options

appname            the name of the app, if it needs to be different from the "productName" or "name"
                   in the nearest package.json

* All platforms *

app-copyright      human-readable copyright line for the app
app-version        release version to set for the app
asar               whether to package the source code within your app into an archive. You can either
                   pass --asar by itself to use the default configuration, OR use dot notation to
                   configure a list of sub-properties, e.g. --asar.unpackDir=sub_dir - do not use
                   --asar and its sub-properties simultaneously.

                   Properties supported:
                   - ordering: path to an ordering file for file packing
                   - unpack: unpacks the files to the app.asar.unpacked directory whose filenames
                     regex .match this string
                   - unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob
                     pattern or exactly match this string. It's relative to the <sourcedir>.
asar-unpack        unpacks the files to the app.asar.unpacked directory whose filenames regex .match
                   this string
                   (Deprecated, use asar.unpack instead)
asar-unpack-dir    unpacks the dir to the app.asar.unpacked directory whose names glob pattern or
                   exactly match this string. It's relative to the <sourcedir>.
                   (Deprecated, use asar.unpackDir instead)
build-version      build version to set for the app
cache              directory of cached Electron downloads. Defaults to `$HOME/.electron`
                   (Deprecated, use --download.cache instead)
deref-symlinks     whether symlinks should be dereferenced. Defaults to true.
download           a list of sub-options to pass to electron-download. They are specified via dot
                   notation, e.g., --download.cache=/tmp/cache
                   Properties supported:
                   - cache: directory of cached Electron downloads. Defaults to `$HOME/.electron`
                   - mirror: alternate URL to download Electron zips
                   - strictSSL: whether SSL certs are required to be valid when downloading
                     Electron. Defaults to true, use --download.strictSSL=false to disable checks.
icon               the icon file to use as the icon for the app. Note: Format depends on platform.
ignore             do not copy files into app whose filenames regex .match this string. See also:
                   https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore
                   and --prune.
out                the dir to put the app into at the end. defaults to current working dir
overwrite          if output directory for a platform already exists, replaces it rather than
                   skipping it
prune              runs `npm prune --production` on the app
strict-ssl         whether SSL certificates are required to be valid when downloading Electron.
                   It defaults to true, use --strict-ssl=false to disable checks.
                   (Deprecated, use --download.strictSSL instead)
tmpdir             temp directory. Defaults to system temp directory, use --tmpdir=false to disable
                   use of a temporary directory.
version            the version of Electron that is being packaged, see
                   https://github.com/electron/electron/releases

* darwin/mas target platforms only *

app-bundle-id      bundle identifier to use in the app plist
app-category-type  the application category type
                   For example, `app-category-type=public.app-category.developer-tools` will set the
                   application category to 'Developer Tools'.
extend-info        a plist file to append to the app plist
extra-resource     a file to copy into the app's Contents/Resources
helper-bundle-id   bundle identifier to use in the app helper plist
osx-sign           (OSX host platform only) Whether to sign the OSX app packages. You can either
                   pass --osx-sign by itself to use the default configuration, or use dot notation
                   to configure a list of sub-properties, e.g. --osx-sign.identity="My Name"
                   Properties supported:
                   - identity: should contain the identity to be used when running `codesign`
                   - entitlements: the path to entitlements used in signing
                   - entitlements-inherit: the path to the 'child' entitlements
protocol           URL protocol scheme to register the app as an opener of.
                   For example, `--protocol=myapp` would register the app to open
                   URLs such as `myapp://path`. This argument requires a `--protocol-name`
                   argument to also be specified.
protocol-name      Descriptive name of URL protocol scheme specified via `--protocol`

* win32 target platform only *

version-string     a list of sub-properties used to set the application metadata embedded into
                   the executable. They are specified via dot notation,
                   e.g. --version-string.CompanyName="Company Inc."
                   or --version-string.ProductName="Product"
                   Properties supported:
                   - CompanyName
                   - FileDescription
                   - OriginalFilename
                   - ProductName
                   - InternalName


npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node/7.2.0/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `electron-packager . $npm_package_productName --prune --asar`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script 'electron-packager . $npm_package_productName --prune --asar'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the gulp-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-packager . $npm_package_productName --prune --asar
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gulp-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gulp-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/musicalapple/work/test/gulp-app/app/npm-debug.log

from gulp-app.

sindresorhus avatar sindresorhus commented on July 28, 2024

Yeah, sorry. Fixed in cd753b9.

from gulp-app.

zeakd avatar zeakd commented on July 28, 2024

Thanks :)

from gulp-app.

Related Issues (20)

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.