Skip to content

Commit ccd06d8

Browse files
committed
Generalized the shell script
1 parent 96d21e9 commit ccd06d8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env sh
22

3+
COMMAND="ember-codemod-v1-to-v2"
34
ENVIRONMENT=$1
45

56
if [ $ENVIRONMENT = "--production" ]
@@ -11,8 +12,12 @@ then
1112
tsc --project "tsconfig.build.json"
1213

1314
# Configure files
14-
chmod +x "dist/bin/ember-codemod-v1-to-v2.js"
15-
cp -r "src/blueprints" "dist/src/blueprints"
15+
chmod +x "dist/bin/$COMMAND.js"
16+
17+
if [ -d "src/blueprints" ]
18+
then
19+
cp -r "src/blueprints" "dist/src/blueprints"
20+
fi
1621

1722
echo "SUCCESS: Built dist.\n"
1823

@@ -25,7 +30,10 @@ then
2530
tsc --project "tsconfig.json"
2631

2732
# Configure files
28-
cp -r "src/blueprints" "dist-for-testing/src/blueprints"
33+
if [ -d "src/blueprints" ]
34+
then
35+
cp -r "src/blueprints" "dist-for-testing/src/blueprints"
36+
fi
2937

3038
echo "SUCCESS: Built dist-for-testing.\n"
3139

0 commit comments

Comments
 (0)