Skip to content

Commit 0d5d3d9

Browse files
committed
Fix init script by providing forwarding scripts
1 parent 499b094 commit 0d5d3d9

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

GETTING_STARTED.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ Use these optional command line options as needed:
5454
./init.sh MyAnalysisProjectName
5555
```
5656

57+
- Change into the analysis directory.
58+
59+
```shell
60+
cd ./temp/MyAnalysisProjectName
61+
```
62+
5763
### 2. Prepare the code to be analyzed
5864

5965
- Move the artifacts (e.g. Java jars json files) you want to analyze into the `artifacts` directory.

init.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ if [ -z "${NEO4J_INITIAL_PASSWORD}" ]; then
3131
exit 1
3232
fi
3333

34+
createForwardingScript() {
35+
local originalScript="${1}"
36+
local scriptName;scriptName=$(basename "$originalScript")
37+
38+
cp -n "${originalScript}" .
39+
echo "#!/usr/bin/env bash" > "./${scriptName}"
40+
# shellcheck disable=SC2016
41+
echo "${originalScript} \"\${@}\"" >> "./${scriptName}"
42+
}
43+
3444
# Create the temporary directory for all analysis projects if it hadn't been created yet.
3545
mkdir -p ./temp
3646
cd ./temp
@@ -45,9 +55,9 @@ mkdir -p "./${ARTIFACTS_DIRECTORY}"
4555
# Create the source directory inside the analysis directory for source code projects/repositories if it hadn't been created yet.
4656
mkdir -p "./${SOURCE_DIRECTORY}"
4757

48-
# Create symbolic links to the most common scripts for code analysis.
49-
ln -s "./../../scripts/analysis/analyze.sh" .
50-
ln -s "./../../scripts/startNeo4j.sh" .
51-
ln -s "./../../scripts/stopNeo4j.sh" .
58+
# Create forwarding scripts for the most important commands
59+
createForwardingScript "./../../scripts/analysis/analyze.sh"
60+
createForwardingScript "./../../scripts/startNeo4j.sh"
61+
createForwardingScript "./../../scripts/stopNeo4j.sh"
5262

5363
echo "init: Successfully initialized analysis project ${analysisName}" >&2

0 commit comments

Comments
 (0)