Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for custom build modes.

  • Loading branch information...
commit af209f2d9d093974ba9dc60d871ff85dcac70dab 1 parent 6b91538
@jarod2d authored
Showing with 3 additions and 4 deletions.
  1. +1 −2  bin/squire
  2. +2 −2 squire.coffee
View
3  bin/squire
@@ -60,10 +60,9 @@ lib.nomnom.command("build").
help("Build your project.").
options(
mode:
- hidden: true
+ abbr: "m"
help: "Specifies the build mode, which affects which config values are used."
default: "build"
- choices: ["build", "preview"]
).
callback (options) -> commands.build.run options
View
4 squire.coffee
@@ -39,7 +39,7 @@ class exports.Squire
userConfigPath = "#{@projectPath}/config/squire.cson"
userConfig = if lib.fs.existsSync userConfigPath then lib.cson.parseFileSync(userConfigPath) or {} else {}
userConfig = lib.merge userConfig.global or {}, userConfig[@mode] or {}
- @config = lib.merge @baseConfigDefaults.global, @baseConfigDefaults[@mode]
+ @config = lib.merge @baseConfigDefaults.global, @baseConfigDefaults[@mode] or {}
@config = lib.merge @config, userConfig
# Store some useful paths.
@@ -168,7 +168,7 @@ class exports.SquirePlugin extends exports.Squire
userConfig = if lib.fs.existsSync userConfigPath then lib.cson.parseFileSync(userConfigPath) or {} else {}
pluginConfig = lib.merge { global: {}, preview: {}, build: {} }, @configDefaults
pluginConfig = lib.merge pluginConfig, userConfig
- pluginConfig = lib.merge pluginConfig.global, pluginConfig[@mode]
+ pluginConfig = lib.merge pluginConfig.global, pluginConfig[@mode] or {}
@config = lib.merge @config, pluginConfig
renderContent: (input, options, callback) ->
Please sign in to comment.
Something went wrong with that request. Please try again.