Skip to content

Commit c2c3522

Browse files
committed
Fixed Non-zeo exit
1 parent 8b7604d commit c2c3522

File tree

3 files changed

+24
-33
lines changed

3 files changed

+24
-33
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ node_modules
55
package-lock.json
66
.idea
77
.swp
8-
LANGS.md.bak
8+
.langs
9+
.vscode/

LANGS.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
11
* [🇺🇸 English](en/)
2-
* [🇧🇬 Български (beta)](bg/)
3-
* [🇨🇿 Čeština (beta)](cs/)
4-
* [🇩🇪 Deutsch](de/)
5-
* [🇬🇷 Ελληνικά (beta)](el/)
6-
* [🇪🇸 Español (beta)](es/)
7-
* [🇮🇷 فارسی (beta)](fa/)
8-
* [🇫🇷 Français (beta)](fr/)
9-
* [🇭🇺 Magyar (beta)](hu/)
10-
* [🇦🇲 հայերեն (beta)](hy/)
11-
* [🇮🇹 Italiano (beta)](it/)
12-
* [🇯🇵 日本語](ja/)
13-
* [🇰🇵/🇰🇷 한국어 (beta)](ko/)
14-
* [🇵🇱 Polski](pl/)
15-
* [🇧🇷 Português-brasileiro](pt/)
16-
* [🇷🇺 Русский (beta)](ru/)
17-
* [🇸🇰 Slovenčina (beta)](sk/)
18-
* [🇹🇷 Türkçe (beta)](tr/)
19-
* [🇺🇦 Українська](uk/)
20-
* [🇨🇳 简体中文](zh/)

Makefile

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
LANG := en
2-
LANG_FILE := $(shell test -f LANGS.md.bak && echo LANGS.md.bak || echo LANGS.md)
2+
LANG_FILE := $(shell test -f .langs && echo .langs || echo LANGS.md)
33
LANG_DATA := $(shell grep "$(LANG)/" $(LANG_FILE))
44
LANG_NAME := $(shell echo "$(LANG_DATA)" | sed 's/.*\[\(.*\)\].*/\1/')
5-
NODE := $(shell which nodse 1> /dev/null && echo "true")
65

76
define ebook_support
87
@if which ebook-convert 1> /dev/null; then\
98
npx honkit $(1) ./ ./djangogirls.$(1);\
109
else\
11-
echo "Error: ebook-convert is not found. Follow the guide at https://honkit.netlify.app/ebook";\
10+
echo "Error: ebook-convert is not found";\
11+
echo " * Follow the guide at https://honkit.netlify.app/ebook";\
12+
echo " - For Debian/Ubuntu, Try: sudo apt install calibre";\
13+
echo " - For MacOS, Try: brew install --cask calibre";\
14+
echo " - For Windows and any other OS, Download from https://github.com/kovidgoyal/calibre/releases";\
15+
false;\
1216
fi
1317
endef
1418

@@ -35,15 +39,20 @@ help:
3539
@echo
3640

3741
check: package.json book.json LANGS.md
38-
ifeq ($(NODE),)
39-
$(error NodeJS not found. Please install/reinstall Node.js. NVM is recommended for installation(https://github.com/nvm-sh/nvm))
40-
endif
42+
@if ! which node 1> /dev/null; then\
43+
echo "Error: Node.js not found";\
44+
echo " * Please install/reinstall NodeJS on your system.";\
45+
echo " * NVM is recommended for installation (https://github.com/nvm-sh/nvm).";\
46+
false;\
47+
fi
4148

4249
setup: check
43-
@if ! test -f "LANGS.md.bak"; then\
44-
cp LANGS.md LANGS.md.bak && echo "Language file backup is created.";\
45-
echo "$(LANG_DATA)" > LANGS.md && echo "Language list is reduced to $(LANG_NAME) for development";\
46-
npm install && echo "Project is ready for development.";\
50+
@if ! test -f ".langs"; then\
51+
cp LANGS.md .langs && \
52+
echo "$(LANG_DATA)" > LANGS.md && \
53+
echo "You are set to $(LANG_NAME) for development";\
54+
npm install && \
55+
echo "Project is ready for development.";\
4756
fi
4857

4958
build: setup
@@ -59,15 +68,15 @@ dev: setup
5968
@npx honkit serve --log=debug
6069

6170
mode:
62-
@if test -f "LANGS.md.bak"; then\
71+
@if test -f ".langs"; then\
6372
echo "You are in development mode";\
6473
else\
6574
echo "You are not in development mode";\
6675
fi
6776

6877
exit:
69-
@if test -f "LANGS.md.bak"; then\
70-
mv -f LANGS.md.bak LANGS.md && echo "Language file is reset";\
78+
@if test -f ".langs"; then\
79+
mv -f .langs LANGS.md && echo "Language file is reset";\
7180
rm -rf node_modules _book && echo "The project exited development mode.";\
7281
fi
7382

0 commit comments

Comments
 (0)