Skip to content

Commit

Permalink
fix(install): When PVW is used as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Aug 23, 2021
1 parent 1a08216 commit 1990880
Showing 1 changed file with 74 additions and 1 deletion.
75 changes: 74 additions & 1 deletion config/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
#!/bin/bash
# FROM: https://github.com/JetBrains/svg-sprite-loader/issues/359#issuecomment-738834513
cat ./config/funcMock.js > ./node_modules/svg-sprite-loader/lib/utils/get-matched-rule.js

function abspath() {
# generate absolute path from relative path
# $1 : relative filename
# return : absolute path
if [ -d "$1" ]; then
# dir
(cd "$1"; pwd)
elif [ -f "$1" ]; then
# file
if [[ $1 = /* ]]; then
echo "$1"
elif [[ $1 == */* ]]; then
echo "$(cd "${1%/*}"; pwd)/${1##*/}"
else
echo "$(pwd)/$1"
fi
fi
}

CURRENT_DIR=`abspath .`
SRC_FILE=`abspath ./config/funcMock.js`
DST_FILE="./node_modules/svg-sprite-loader/lib/utils/get-matched-rule.js"

cd $CURRENT_DIR
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi
cd ..
if [ -f "$DST_FILE" ]; then
cat "$SRC_FILE" > "$DST_FILE"
exit 0
fi

0 comments on commit 1990880

Please sign in to comment.