mirror of
https://github.com/vapor/toolbox.git
synced 2025-04-19 16:50:44 +08:00
Compatibility with official swift container images (#390)
* Compatibility with official swift container images Sudo is not available in containers, running sudo breaks `make install`. Solve the issue by checking whether the user is root, and if he is, no need to use sudo. * Indent fix line 24 indentation should use tab * ifneq, else and endif should not be indented in makefiles
This commit is contained in:
parent
cddcfa9b32
commit
c515b616bc
13
Makefile
13
Makefile
@ -5,9 +5,22 @@ build:
|
||||
./build
|
||||
rm ./build
|
||||
install: build
|
||||
# if uid does not equal 0
|
||||
# user is not root and must use sudo
|
||||
ifneq ($(shell id -u), 0)
|
||||
sudo mv .build/release/vapor ${DEST}
|
||||
sudo chmod 755 ${DEST}
|
||||
# if uid is 0
|
||||
# user is root and perhaps sudo is not available
|
||||
else
|
||||
mv .build/release/vapor ${DEST}
|
||||
chmod 755 ${DEST}
|
||||
endif
|
||||
uninstall:
|
||||
ifneq ($(shell id -u), 0)
|
||||
sudo rm ${DEST}
|
||||
else
|
||||
rm ${DEST}
|
||||
endif
|
||||
clean:
|
||||
rm -rf .build
|
||||
|
Loading…
x
Reference in New Issue
Block a user