Skip to content

CLI options

ragulka edited this page Mar 23, 2018 · 3 revisions

Sake will automatically parse CLI options and pass them to tasks. However, this does not include plugin-specific CLI options, such as --bare for the CoffeeScript plugin. CLI options are designed to be used for lightweight runtime configuration. For example, specifying --minify=false will skip minifying scripts and styles during the compile task.

Options are passed around as a property of the sake object, so any task can look for sake.options. The deploy task is using it extensively to pass around prompt answers, etc.

Sake has retained most of the CLI options from our Grunt build system, mostly relating to version bumps and the upfw task.

Global options

  • minify - whether to minify styles and scripts during compile/build/deploy - defaults to true.
  • skip_pot - whether to skip compiling the POT file during compile/build/deploy - defaults to false.

Task-specific options

upfw

sake upfw --backwards_compatible=4.4 --minimum_wc_version=2.5.5 --tested_up_to_wc_version=2.7.0 --minimum_wp_version=4.1 --tested_up_to_wp_version=4.6

  • branch - the branch to update the plugin framework from, only applicable for FW v4 plugins, defaults to legacy-v4
  • skip-composer-update - whether to skip composer update during the framework update, only applicable to FW v5 plugins, defaults to false
  • All the bump:minreqs options

bump:minreqs

  • minimum_wc_version - the minimum required WC version
  • minimum_wp_version - the minimum required WP version
  • minimum_php_version - the minimum required PHP version
  • tested_up_to_wc_version - the "tested up to" WC version
  • tested_up_to_wp_version - the "tested up to" WP version
  • framework_version - the required framework version, only applicable to FW v4 plugins
  • backwards_compatible - the lowest framework version this plugin is compatible with, only applicable to FW v4 plugins

config

  • property - an optional path to the property you want to examine, for example: deploy.production.url

lint:coffee

  • coffeelint-file - optional path to a custom coffeelint.json file

lint:js

  • eslint-configFile - optional path to a custom .eslintrc file

compress|zip

  • zipDest - optional custom ZIP file destination path