-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdspm
executable file
·38 lines (28 loc) · 844 Bytes
/
dspm
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
37
38
#!/usr/bin/env bash
CWD=$(pwd)
DSPM_VERSION=0.5.2
ensureArtifact () {
if [ ! -d "$CWD/.dspm" ]; then
echo "Installing dspm version $DSPM_VERSION"
wget -q "https://github.com/Mamoru1234/dspm/releases/download/$DSPM_VERSION/dspm.tar.gz"
mkdir -p .dspm/dist
tar -xzf dspm.tar.gz -C .dspm/dist
rm -f dspm.tar.gz
fi
}
ensureConfig () {
if [ ! -f "$CWD/dspm.config.js" ]; then
read -p "Do you want to generate default config? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo """const { applyJSProjectPlugin } = require('./.dspm/dist/main/plugins/JSProjectPlugin');
module.exports = (project) => {
applyJSProjectPlugin(project);
};
""" >> "$CWD/dspm.config.js"
fi
fi
}
ensureArtifact
ensureConfig
node ./.dspm/dist/bin/dspm.js $@