Skip to content

Commit 610fd91

Browse files
committed
Update code to support tarball creation
1 parent 93da30b commit 610fd91

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
while getopts "v:" opt; do
4+
case $opt in
5+
v) version="$OPTARG"
6+
;;
7+
\?) echo "Invalid option -$OPTARG" >&2
8+
exit 1
9+
;;
10+
esac
11+
12+
case $OPTARG in
13+
-*) echo "Option $opt needs a valid argument"
14+
exit 1
15+
;;
16+
esac
17+
done
18+
19+
if [[ -z $version ]]; then
20+
echo "Please provide version using '-v'";
21+
exit 1
22+
fi
23+
24+
VERSION=$version
25+
# Set current project root
26+
PROJ_ROOT=$(pwd)
27+
28+
mkdir -p ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}
29+
rm -rf ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src
30+
mkdir -p ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src
31+
cp -a ${PROJ_ROOT}/vscode/. ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src/
32+
rm -rf ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}.tar.gz
33+
cd ${PROJ_ROOT}/sagemaker-code-editor
34+
tar -czf code-editor${VERSION}.tar.gz code-editor${VERSION}
35+
cd ${PROJ_ROOT}
36+
cp ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}.tar.gz ${PROJ_ROOT}/
37+
rm -rf ${PROJ_ROOT}/sagemaker-code-editor
38+
sha256sum ${PROJ_ROOT}/code-editor${VERSION}.tar.gz

scripts/install.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ PROJ_ROOT=$(pwd)
1010
printf "\n======== Cleaning out patches ========\n"
1111
quilt pop -a
1212

13+
# empty vscode module
14+
printf "\n======== Delete data is vs code module if present ========\n"
15+
rm -rf ${PROJ_ROOT}/vscode/.
16+
1317
# re-enable -e to allow exiting on error
1418
set -e
1519

@@ -31,6 +35,10 @@ printf "\n======== Applying patches ========\n"
3135
printf "\n======== Comment out breaking git config lines in postinstall.js ========\n"
3236
sh ${PROJ_ROOT}/scripts/postinstall.sh
3337

38+
# Build tarball for conda feedstock from vscode dir
39+
printf "\n======== Build Tarball for Conda Feedstock ========\n"
40+
bash ${PROJ_ROOT}/scripts/create_code_editor_tarball.sh -v 1.2.0
41+
3442
# Copy resources
3543
printf "\n======== Copy resources ========\n"
3644
sh ${PROJ_ROOT}/scripts/copy-resources.sh
@@ -40,6 +48,6 @@ printf "\n======== Deleting vscode/node_modules ========\n"
4048
rm -rf "${PROJ_ROOT}/vscode/node_modules"
4149

4250
# Build the project
43-
printf "\n======== Building project in ${PROJ_ROOT}/vscode ========\n"
51+
#printf "\n======== Building project in ${PROJ_ROOT}/vscode ========\n"
4452
yarn --cwd "${PROJ_ROOT}/vscode" install --pure-lockfile --verbose
4553
yarn --cwd "${PROJ_ROOT}/vscode" download-builtin-extensions

scripts/postinstall.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ if [ ! -f "$POSTINSTALL_JS_PATH" ]; then
1616
fi
1717

1818
# Use sed to comment out the specific lines
19-
sed -i '' '/cp\.execSync('"'"'git config pull\.rebase merges'"'"');/s/^/\/\/ /' "$POSTINSTALL_JS_PATH"
20-
sed -i '' '/cp\.execSync('"'"'git config blame\.ignoreRevsFile \.git-blame-ignore'"'"');/s/^/\/\/ /' "$POSTINSTALL_JS_PATH"
19+
sed -i '' '/cp\.execSync('"'"'git config .*);/s/^/\/\/ /' "$POSTINSTALL_JS_PATH"
2120

22-
echo "Specified git config lines have been commented out in $POSTINSTALL_JS_PATH."
21+
echo "Specified git config lines have been commented out in $POSTINSTALL_JS_PATH."

0 commit comments

Comments
 (0)