From 1a8c308b6aafa888d00a62bccd5af50bde7d6e3c Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Wed, 28 Jun 2017 09:51:44 -0400 Subject: [PATCH] move buildDir and distDir to meta file --- scripts/deploy/build.coffee | 21 --------------------- scripts/deploy/index.coffee | 3 ++- scripts/deploy/meta.coffee | 28 ++++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/scripts/deploy/build.coffee b/scripts/deploy/build.coffee index 7ebc38467e..cf2301c4c0 100644 --- a/scripts/deploy/build.coffee +++ b/scripts/deploy/build.coffee @@ -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/ - ## / = 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) diff --git a/scripts/deploy/index.coffee b/scripts/deploy/index.coffee index 6484cdd92f..6a0c606640 100644 --- a/scripts/deploy/index.coffee +++ b/scripts/deploy/index.coffee @@ -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) diff --git a/scripts/deploy/meta.coffee b/scripts/deploy/meta.coffee index 3eab53157b..583bdfb458 100644 --- a/scripts/deploy/meta.coffee +++ b/scripts/deploy/meta.coffee @@ -1,7 +1,31 @@ path = require("path") +## returns a path into the /build directory +## the output folder should look something like this +## build/ +## / = 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") }