Skip to content

Commit d1978fa

Browse files
Fix more random issues
1 parent f03721f commit d1978fa

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/build_obsidian_plugin.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ build_obsidian_plugin() {
2525
echo "Obsidian plugin manifest.json file not found at path $plugin_source!"; exit 4
2626
fi
2727

28-
local plugin_json=$(cat ./manifest.json) || {
28+
local plugin_json
29+
plugin_json=$(cat ./manifest.json) || {
2930
echo "Error: failed to read Obsidian plugin manifest.json file at path $plugin_source!"; exit 5
3031
}
3132

32-
local plugin_id=$(echo $plugin_json | jq -r .id) || {
33+
local plugin_id
34+
plugin_id=$(echo "$plugin_json" | jq -r .id) || {
3335
echo "Error: failed to read Obsidian plugin ID from manifest.json file when building plugin at path $plugin_source!"; exit 6
3436
}
3537

@@ -71,7 +73,7 @@ build_obsidian_plugin() {
7173
echo "Error: failed to install Obsidian plugin $plugin_id sub-project!"; exit 8
7274
}
7375

74-
popd > /dev/null
76+
popd > /dev/null || exit
7577

7678
npm run build || {
7779
echo "Error: failed to build Obsidian plugin $plugin_id!"; exit 8
@@ -100,10 +102,10 @@ build_obsidian_plugin() {
100102
;;
101103
esac
102104

103-
popd > /dev/null
105+
popd > /dev/null || exit
104106
done
105107
}
106108

107-
if [ $1 != --source-only ]; then
108-
build_obsidian_plugin $@
109+
if [ "$1" != --source-only ]; then
110+
build_obsidian_plugin "$@"
109111
fi

0 commit comments

Comments
 (0)