Skip to content

Commit 9e33864

Browse files
committed
🐛 fix: multiple components in ztoq.sh
- use double bracket - change from `-e` to `-f` - attach double quotation marks
1 parent da5c8ca commit 9e33864

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/ztoq.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
FILE=$1
44

5-
FILENAME=$(basename $FILE .md)
6-
if [ $FILE != ./articles/* ]; then
7-
if [ -e "qiita/public/$FILENAME.md" ]; then
5+
FILENAME=$(basename "$FILE" .md)
6+
if [[ "$FILE" != ./articles/* ]]; then
7+
if [[ -f "qiita/public/$FILENAME.md" ]]; then
88
echo "delete qiita/public/$FILENAME.md cuz it's not included in articles/"
99
rm "qiita/public/$FILENAME.md"
1010
fi
1111
exit 0
1212
fi
1313

14-
if [ ! -e "qiita/public/$FILENAME.md" ] && grep -q "published: true" "$FILE"; then
14+
if [[ ! -f "qiita/public/$FILENAME.md" ]] && grep -q "published: true" "$FILE"; then
1515
cd ./qiita
1616
echo "generate qiita/public/$FILENAME.md"
1717
npx qiita new "$FILENAME"

0 commit comments

Comments
 (0)