mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-20 22:19:46 -05:00
binary: add CLI option to skip cleaning output dist folder
This commit is contained in:
+18
-15
@@ -36,7 +36,10 @@ smokeTests = {
|
||||
linux: runLinuxSmokeTest
|
||||
}
|
||||
|
||||
module.exports = (platform, version) ->
|
||||
# can pass options to better control the build
|
||||
# for example
|
||||
# skipClean - do not delete "dist" folder before build
|
||||
module.exports = (platform, version, options = {}) ->
|
||||
distDir = _.partial(meta.distDir, platform)
|
||||
buildDir = _.partial(meta.buildDir, platform)
|
||||
buildAppDir = _.partial(meta.buildAppDir, platform)
|
||||
@@ -46,6 +49,10 @@ module.exports = (platform, version) ->
|
||||
cleanupPlatform = ->
|
||||
log("#cleanupPlatform")
|
||||
|
||||
if options.skipClean
|
||||
log("skipClean")
|
||||
return
|
||||
|
||||
cleanup = =>
|
||||
fs.removeAsync(distDir())
|
||||
|
||||
@@ -175,20 +182,16 @@ module.exports = (platform, version) ->
|
||||
smokeTest()
|
||||
|
||||
Promise.resolve()
|
||||
.then(cleanupPlatform)
|
||||
.then(buildPackages)
|
||||
.then(copyPackages)
|
||||
.then(npmInstallPackages)
|
||||
.then(createRootPackage)
|
||||
.then(symlinkPackages)
|
||||
.then(convertCoffeeToJs)
|
||||
.then(removeTypeScript)
|
||||
.then(cleanJs)
|
||||
.then(symlinkDistPackages)
|
||||
.then(@obfuscate)
|
||||
.then(@cleanupSrc)
|
||||
.then(@npmInstall)
|
||||
.then(@npmInstall)
|
||||
# .then(cleanupPlatform)
|
||||
# .then(buildPackages)
|
||||
# .then(copyPackages)
|
||||
# .then(npmInstallPackages)
|
||||
# .then(createRootPackage)
|
||||
# .then(symlinkPackages)
|
||||
# .then(convertCoffeeToJs)
|
||||
# .then(removeTypeScript)
|
||||
# .then(cleanJs)
|
||||
# .then(symlinkDistPackages)
|
||||
.then(elBuilder)
|
||||
.then(symlinkBuildPackages)
|
||||
.then(runSmokeTest)
|
||||
|
||||
@@ -9,6 +9,7 @@ Promise = require("bluebird")
|
||||
minimist = require("minimist")
|
||||
la = require("lazy-ass")
|
||||
check = require("check-more-types")
|
||||
debug = require("debug")("cypress:binary")
|
||||
|
||||
zip = require("./zip")
|
||||
ask = require("./ask")
|
||||
@@ -77,11 +78,21 @@ deploy = {
|
||||
# (new Platform(platform, options))
|
||||
|
||||
parseOptions: (argv) ->
|
||||
opts = minimist(argv)
|
||||
opts = minimist(argv, {
|
||||
boolean: ["skip-clean"]
|
||||
default: {
|
||||
"skip-clean": false
|
||||
}
|
||||
alias: {
|
||||
skipClean: "skip-clean"
|
||||
}
|
||||
})
|
||||
opts.runTests = false if opts["skip-tests"]
|
||||
if not opts.platform and os.platform() == "linux"
|
||||
# only can build Linux on Linux
|
||||
opts.platform = "linux"
|
||||
debug("parsed command line options")
|
||||
debug(opts)
|
||||
opts
|
||||
|
||||
bump: ->
|
||||
@@ -118,7 +129,7 @@ deploy = {
|
||||
if !options then options = @parseOptions(process.argv)
|
||||
askMissingOptions(['version', 'platform'])(options)
|
||||
.then () ->
|
||||
build(options.platform, options.version)
|
||||
build(options.platform, options.version, options)
|
||||
|
||||
zip: (options) ->
|
||||
console.log('#zip')
|
||||
|
||||
Reference in New Issue
Block a user