1
0
mirror of https://github.com/pgrondek/config.git synced 2024-11-22 12:03:43 +00:00

[nodejs] Created nodejs installation script

This commit is contained in:
Przemysław Grondek 2019-11-19 09:53:51 +01:00
parent f670ef7dc6
commit 56fe303b08

25
nodejs/Makefile Normal file
View File

@ -0,0 +1,25 @@
NODE_PACKAGES=nodejs
VERSION=node_12.x
NODE_BIN=/usr/bin/nodejs
ROOT_TEE=sudo tee
ROOT_APT=sudo aptitude
ROOT_ADD_KEY=sudo apt-key
ROOT_ADD_USER_TO_GROUP=sudo adduser
ROOT_ADD_PPA=add-apt-repository -y
RELEASE:=$(shell lsb_release -cs)
clean:
-$(ROOT_APT) -y purge $(NODE_PACKAGES)
-$(ROOT_ADD_PPA) -i ppa:chris-lea/node.js
-sudo rm -f /etc/apt/sources.list.d/chislea-node_js-*.list
-sudo rm -f /etc/apt/sources.list.d/chislea-node_js-*.list.save
install: $(NODE_BIN)
$(NODE_BIN):
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | $(ROOT_ADD_KEY) add -
echo "deb https://deb.nodesource.com/$(VERSION) $(RELEASE) main" | $(ROOT_TEE) /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/$(VERSION) $(RELEASE) main" | $(ROOT_TEE) -a /etc/apt/sources.list.d/nodesource.list
$(ROOT_APT) update
$(ROOT_APT) install -y $(NODE_PACKAGES)