diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 89c0b88..82f5977 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -14,30 +14,26 @@ jobs: test-ubuntu: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + - name: Test installation run: | - make install - - name: Test updating - run: | - make update + sudo make install + - name: Test uninstall run: | - make install - make uninstall + sudo make install + sudo make uninstall test-macos: runs-on: macos-12 steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + - name: Test installation run: | make install - - name: Test updating - run: | - make update + - name: Test uninstall run: | make install diff --git a/BSDmakefile b/BSDmakefile index ed64fa4..7cf9410 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -1,31 +1,22 @@ PREFIX = $(HOME)/.local BIN = /usr/bin MAN_DIR = /usr/share/man/man1 -SUDO := doas all: @echo Run \'make install\' to install BashPass. - @echo Run \'make update\' to update BashPass. @echo Run \'make uninstall\' to uninstall BashPass. install: @echo Installing BashPass... - @$(SUDO) install -v -m755 bashpass $(BIN) - @$(SUDO) install -v -m644 docs/bashpass.1.gz $(MAN_DIR) - @$(SUDO) install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) + install -v -m755 bashpass $(BIN) + install -v -m644 docs/bashpass.1.gz $(MAN_DIR) + install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) @echo BashPass installed successfully! -update: - @echo Updating BashPass... - @$(SUDO) install -v -m755 bashpass $(BIN) - @$(SUDO) install -v -m644 docs/bashpass.1.gz $(MAN_DIR) - @$(SUDO) install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) - @echo BashPass updated successfully! - uninstall: @echo Uninstalling BashPass... - @$(SUDO) rm -vf $(BIN)/bashpass - @$(SUDO) rm -vf $(MAN_DIR)/bashpass.1.gz - @$(SUDO) rm -vf $(MAN_DIR)/bashpass.conf.1.gz + rm -vf $(BIN)/bashpass + rm -vf $(MAN_DIR)/bashpass.1.gz + rm -vf $(MAN_DIR)/bashpass.conf.1.gz @echo BashPass uninstalled successfully! @echo Bye, have a nice day! diff --git a/GNUmakefile b/GNUmakefile index ec1b190..1a16ed1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,7 +1,6 @@ PREFIX = $(HOME)/.local BIN = /usr/bin MAN_DIR = /usr/share/man/man1 -SUDO := sudo OS := $(shell uname -s) # Check if the operating system is Linux @@ -10,7 +9,7 @@ ifeq ($(OS),Linux) MAN_DIR = /usr/share/man/man1 endif -# Check if the operating system is Mac OS X +# Check if the operating system is macOS X ifeq ($(OS),Darwin) BIN = /usr/local/bin MAN_DIR = /usr/local/share/man/man1 @@ -18,27 +17,19 @@ endif all: @echo Run \'make install\' to install BashPass. - @echo Run \'make update\' to update BashPass. @echo Run \'make uninstall\' to uninstall BashPass. install: @echo Installing BashPass... - @$(SUDO) install -v -m755 bashpass $(BIN) - @$(SUDO) install -v -m644 docs/bashpass.1.gz $(MAN_DIR) - @$(SUDO) install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) + install -v -m755 bashpass $(BIN) + install -v -m644 docs/bashpass.1.gz $(MAN_DIR) + install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) @echo BashPass installed successfully! -update: - @echo Updating BashPass... - @$(SUDO) install -v -m755 bashpass $(BIN) - @$(SUDO) install -v -m644 docs/bashpass.1.gz $(MAN_DIR) - @$(SUDO) install -v -m644 docs/bashpass.conf.1.gz $(MAN_DIR) - @echo BashPass updated successfully! - uninstall: @echo Uninstalling BashPass... - @$(SUDO) rm -vf $(BIN)/bashpass - @$(SUDO) rm -vf $(MAN_DIR)/bashpass.1.gz - @$(SUDO) rm -vf $(MAN_DIR)/bashpass.conf.1.gz + rm -vf $(BIN)/bashpass + rm -vf $(MAN_DIR)/bashpass.1.gz + rm -vf $(MAN_DIR)/bashpass.conf.1.gz @echo BashPass uninstalled successfully! @echo Bye, have a nice day!