move buildDir and distDir to meta file

This commit is contained in:
Gleb Bahmutov
2017-06-28 09:51:44 -04:00
parent dd0dca3fa1
commit 1a8c308b6a
3 changed files with 28 additions and 24 deletions

View File

@@ -34,27 +34,6 @@ smokeTests = {
}
module.exports = (platform, version) ->
## returns a path into the /dist directory
distDir = (args...) ->
path.resolve("dist", platform, args...)
## returns a path into the /build directory
## the output folder should look something like this
## build/
## <platform>/ = linux or darwin
## ... platform-specific files
buildDir = (args...) ->
path.resolve("build", platform, args...)
## returns a path into the /build/*/app directory
## specific to each platform
buildAppDir = (args...) ->
switch platform
when "darwin"
buildDir("Cypress.app", "Contents", "resources", "app", args...)
when "linux"
buildDir("resources", "app", args...)
cleanupPlatform = ->
log("#cleanupPlatform", platform)

View File

@@ -144,8 +144,9 @@ deploy = {
zip: ->
# TODO only ask for built folder name
options = @parseOptions(process.argv)
askMissingOptions(['version', 'platform'])(options)
askMissingOptions(['platform'])(options)
.then (options) =>
buildDir = meta.buildDir(options.platform)
dest = path.resolve(zippedFilename(options.platform))
zip.ditto(buildDir, dest)

View File

@@ -1,7 +1,31 @@
path = require("path")
## returns a path into the /build directory
## the output folder should look something like this
## build/
## <platform>/ = linux or darwin
## ... platform-specific files
buildDir = (platform, args...) ->
path.resolve("build", platform, args...)
## returns a path into the /dist directory
distDir = (platform, args...) ->
path.resolve("dist", platform, args...)
## returns a path into the /build/*/app directory
## specific to each platform
buildAppDir = (platform, args...) ->
switch platform
when "darwin"
buildDir("Cypress.app", "Contents", "resources", "app", args...)
when "linux"
buildDir("resources", "app", args...)
module.exports = {
distDir: path.join(process.cwd(), "dist")
buildDir: path.join(process.cwd(), "build")
buildDir
distDir
buildAppDir
# distDir: path.join(process.cwd(), "dist")
# buildDir: path.join(process.cwd(), "build")
cacheDir: path.join(process.cwd(), "cache")
}