Skip to content

Commit 11be5fe

Browse files
committed
💚 use given template and clean variations when ready
1 parent 873a03d commit 11be5fe

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/scaffold.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

3-
const BRANCH_NAME = process.env.BRANCH_NAME
4-
const SEMAPHORE_REPO_SLUG = process.env.SEMAPHORE_REPO_SLUG
3+
const projectDir = process.env.SEMAPHORE_PROJECT_DIR
54
const templateName = process.argv[2]
65

76
const suppose = require('suppose')
@@ -10,18 +9,16 @@ const template = require('./builds.json')[templateName]
109
const YELLOW = '\x1b[33m'
1110
const END = '\x1b[0m'
1211

13-
process.chdir(process.cwd() + '/builds')
14-
1512
generate(templateName, template)
1613

1714
setTimeout(() => {
1815
process.exit()
19-
}, 10000)
16+
}, 4000)
2017

2118
function generate (key, build) {
2219
console.log(`${YELLOW}Generating \`${key}\`${END}`)
2320

24-
suppose('vue', ['init', `${SEMAPHORE_REPO_SLUG}#${BRANCH_NAME}`, key], { debug: process.stdout })
21+
suppose('vue', ['init', `${projectDir}`, key], { debug: process.stdout })
2522
.when(/Application Name/g).respond(build[0])
2623
.when(/Project description/g).respond(build[1])
2724
.when(/version/g).respond(build[2])

tests/scaffold.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
# Scaffold boilerplate with given templateName
5-
cd "$PWD/tests"
5+
cd "$PWD/tests/builds"
66
node scaffold.js "$1"
77

88
# Install dependecies
@@ -14,3 +14,7 @@ npm test
1414

1515
# Run webpack and build electron
1616
npm run build
17+
18+
# Clean up current scaffold
19+
cd ..
20+
rm -rf "$1"

0 commit comments

Comments
 (0)