Skip to content

Commit 029b9bd

Browse files
authored
Add build:local script (wix#2245)
* Add build:local script * Remove package.json changes and rename tar * Move tar to Downloads
1 parent b25d5d4 commit 029b9bd

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"xcode": "xed ios",
2828
"build:dev": "tsc --p tsconfig.dev.json",
2929
"build": "node scripts/build.js",
30+
"build:local": "./scripts/createLocalPackage.sh",
3031
"pre-push": "npm run build:dev && npm run test",
3132
"docs:deploy": "./scripts/deployDocs.sh",
3233
"docs:build": "node scripts/buildDocs.js",

scripts/createLocalPackage.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Test if there are currently untracked files and notify the user they exist (do not move things around for the user)
4+
FILES_TO_CLEAN=$(git clean -n)
5+
if [ ! -z "$FILES_TO_CLEAN" ]
6+
then
7+
echo "Please note that a byproduct is deleting ALL untracked files from your folder, these files will be deleted:"
8+
echo "${FILES_TO_CLEAN}"
9+
select yn in "Yes" "No"; do
10+
case $yn in
11+
Yes ) break;;
12+
No ) exit;;
13+
esac
14+
done
15+
fi
16+
17+
PACKAGE_JSON=$(git diff package.json)
18+
if [ ! -z "$PACKAGE_JSON" ]
19+
then
20+
echo "Your changes to pacakge.json will be erased, continue?"
21+
select yn in "Yes" "No"; do
22+
case $yn in
23+
Yes ) break;;
24+
No ) exit;;
25+
esac
26+
done
27+
fi
28+
29+
# Delete previous tar
30+
rm -f ~/Downloads/react-native-ui-lib.tgz
31+
# Build javascript files
32+
npm run build
33+
# Package into a tar
34+
npm pack
35+
# Rename tar and move to Downloads
36+
mv react-native-ui-lib-5.0.0.tgz ~/Downloads/react-native-ui-lib.tgz
37+
# Clean ALL untracked files
38+
git clean -f
39+
git checkout package.json

0 commit comments

Comments
 (0)