Add makefile and improve scrips

Add makefile and improve scrips

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
pull/2/head
Bensuperpc 2 years ago
parent 56c7d92510
commit dc6a1b6a25

@ -29,11 +29,11 @@ jobs:
submodules: 'recursive'
fetch-depth: 0
- name: "✅ Check bash syntax"
run: find . -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" -exec bash -n {} \;
run: find . -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" -exec bash -n {} \;
- name: "🛠️ Install"
run: sudo ./install.sh --yes
run: sudo make install
- name: "🧹 Uninstall"
run: sudo ./uninstall.sh --yes
run: sudo make uninstall
check-quality:
runs-on: ubuntu-latest
name: A job to check my code quality

2
.gitignore vendored

@ -127,3 +127,5 @@ dmypy.json
# Pyre type checker
.pyre/
package_build/*
scripts-1.0.7z

@ -0,0 +1,48 @@
#//////////////////////////////////////////////////////////////
#// ____ //
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
#// |_| |_| //
#//////////////////////////////////////////////////////////////
#// //
#// Script, 2021 //
#// Created: 17, June, 2021 //
#// Modified: 17, June, 2021 //
#// file: - //
#// - //
#// Source: https://github.com/metal3d/bashsimplecurses //
#// OS: ALL //
#// CPU: ALL //
#// //
#//////////////////////////////////////////////////////////////
PROJECT_NAME := scripts
SHELL := bash
VERSION := 1.0
all: install
install:
@echo "Install libraries..."
sudo ./install.sh --yes
@echo "done"
uninstall:
@echo "Removing libraries"
sudo ./uninstall.sh --yes
@echo "done"
sync-submodule:
git submodule update --init --recursive
git submodule update --recursive --remote
dist: clean sync-submodule
mkdir -p package_build
rsync -a --progress --exclude='package_build/' --exclude='*.gitignore' --exclude='*.git/' --exclude='*.circleci/' --exclude='*.github/' . package_build/
7z a $(PROJECT_NAME)-$(VERSION).7z package_build/ -m0=lzma2 -mx=7 -mmt -ms
@echo "$(PROJECT_NAME)-$(VERSION).7z done"
clean:
rm -rf package_build/
rm -f $(PROJECT_NAME)-$(VERSION).7z

@ -50,14 +50,19 @@ echo "Pull Submodule done"
echo "Install ben's scripts"
echo "Clean..."
sudo find /usr/bin -lname '/usr/bin/ben_script/*' -delete
sudo rm -rf /usr/bin/ben_script
echo "Clean done"
echo "copy..."
sudo mkdir -p /usr/bin/ben_script && sudo cp -a . /usr/bin/ben_script
echo "copy done"
echo "Install ben's scripts..."
echo "create symlink..."
find /usr/bin/ben_script -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" -exec sudo ln -s {} /usr/bin \;
find /usr/bin/ben_script -type f -name "*.py" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" -exec sudo ln -s {} /usr/bin \;
find /usr/bin/ben_script -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" -exec sudo ln -s {} /usr/bin \;
find /usr/bin/ben_script -type f -name "*.py" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" -exec sudo ln -s {} /usr/bin \;
# Move it by remove file extension (if does not exit)
find /usr/bin -lname '/usr/bin/ben_script/*.sh' | while read NAME ; do sudo mv -nv "${NAME}" "${NAME%.sh}" ; done
echo "create symlink done"

@ -41,6 +41,14 @@ else
fi
fi
DIR="/usr/bin/ben_script/"
if [ ! -d "$DIR" ]; then
# Take action if $DIR exists. #
echo "${DIR} does not exist..."
exit 0
fi
echo "Removing Bash-Snippet..."
cd /usr/bin/ben_script/Bash-Snippet
sudo ./uninstall.sh all

Loading…
Cancel
Save