Skip to content

Commit bccb303

Browse files
authored
Specify that SHELL is bash, since bashisms ([[ COND ]]) are used (#1073)
Without the fix, on the system with POSIX compliant /bin/sh (dash etc) you could get ❯ make install /bin/sh: 1: [[: not found MKDIR /home/yoh/.local/share/gnome-shell/extensions LINK [email protected] INSTALL SUCCESSFUL: If this is the first time installing PaperWM, then please logout/login and enable the PaperWM extension, either with the GNOME Extensions application, or manually by executing the following command from a terminal: gnome-extensions enable [email protected] after a fix ``` ❯ make install INSTALL FAILED: A previous (non-symlinked) installation of PaperWM already exists at: '/home/yoh/.local/share/gnome-shell/extensions/[email protected]'. Please remove the installed version from that path and re-run this install script. make: *** [Makefile:40: install] Error 1 ``` and I think I will follow up with an additional fix now for using `-e` so those fail overall whenever first error happens instead of keeping plowing through! ... <details> <summary>actually such patch didn't work as it kept plowing through after the error</summary> ```shell diff --git a/Makefile b/Makefile index e51dde7..441e78e 100644 --- a/Makefile +++ b/Makefile @@ -30,14 +30,14 @@ else GNOME_EXT_DISABLE := gnome-shell-extension-tool --disable endif -SHELL=/bin/bash +SHELL=/bin/bash -e ## Update compiled files all: $(RELEASE_FILES) ## Install PaperWM on this system install: schemas/gschemas.compiled - @if [[ ! -L "$(TARGET)" && -d "$(TARGET)" ]]; \ + @if [[[ ! -L "$(TARGET)" && -d "$(TARGET)" ]]; \ then \ echo; \ echo "INSTALL FAILED:"; \ ``` ``` ❯ make install /bin/bash: line 1: [[[: command not found MKDIR /home/yoh/.local/share/gnome-shell/extensions LINK [email protected] INSTALL SUCCESSFUL: If this is the first time installing PaperWM, then please logout/login and enable the PaperWM extension, either with the GNOME Extensions application, or manually by executing the following command from a terminal: gnome-extensions enable [email protected] changes on filesystem: Makefile | 4 ++-- ``` </details> so might be better to just make them proper outside bash scripts and invoke here ... will not do in this PR
2 parents c69a16c + 9238b11 commit bccb303

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ else
3030
GNOME_EXT_DISABLE := gnome-shell-extension-tool --disable
3131
endif
3232

33+
SHELL=/bin/bash
34+
3335
## Update compiled files
3436
all: $(RELEASE_FILES)
3537

@@ -68,7 +70,7 @@ uninstall:
6870
@if [[ `readlink -f $(TARGET)` != `readlink -f $$PWD` ]]; \
6971
then \
7072
echo "'$(TARGET)' does not link to '$$PWD', refusing to remove."; \
71-
exit 1 \
73+
exit 1; \
7274
fi
7375
@if [ -L $(TARGET) ]; \
7476
then \
@@ -77,7 +79,7 @@ uninstall:
7779
else \
7880
read -p "Remove $(TARGET)? (y/N): " -n 1 -r \
7981
echo \
80-
[[ $$REPLY =~ ^[Yy]$ ]] && rm -rf $(TARGET) \
82+
[[ $$REPLY =~ ^[Yy]$ ]] && rm -rf $(TARGET); \
8183
fi
8284

8385

0 commit comments

Comments
 (0)