-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path0-setup.sh
More file actions
executable file
·36 lines (29 loc) · 1.17 KB
/
Copy path0-setup.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
echo "Verifying location of Scratch source is known"
if [ -z "$SCRATCH_SRC_HOME" ]; then
echo "Error: SCRATCH_SRC_HOME environment variable is not set."
exit 1
fi
echo "Checking if Scratch source has already been customized"
if [ -e $SCRATCH_SRC_HOME/patched ]; then
exit 1
fi
echo "Getting the location of this script"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $DIR
echo "Adding extension to Scratch source"
cd $SCRATCH_SRC_HOME/packages/scratch-vm/src/extensions
ln -s $DIR/your-scratch-extension your-scratch-extension
echo "Patching Scratch source to enable extension"
cd $SCRATCH_SRC_HOME
git apply $DIR/patches/scratch-vm.patch
git apply $DIR/patches/scratch-gui.patch
git apply $DIR/patches/webpack.patch
echo "Copying in the Scratch extension files"
mkdir -p $SCRATCH_SRC_HOME/packages/scratch-gui/src/lib/libraries/extensions/yourextension
cd $SCRATCH_SRC_HOME/packages/scratch-gui/src/lib/libraries/extensions/yourextension
ln -s $DIR/your-extension-background.png your-extension-background.png
ln -s $DIR/your-extension-icon.png your-extension-icon.png
echo "Marking the Scratch source as customized"
touch $SCRATCH_SRC_HOME/patched