Fix shellcheck (./bin/portzap), and add .shellcheckrc
This commit is contained in:
parent
e87c6c5867
commit
bd4292f6ca
2 changed files with 14 additions and 8 deletions
5
.shellcheckrc
Normal file
5
.shellcheckrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
external-sources=true
|
||||||
|
source=./libexec/portzap/commands/portzap-install
|
||||||
|
source=./libexec/portzap/commands/portzap-pull
|
||||||
|
source=./libexec/portzap/commands/portzap-clone
|
||||||
|
source=./libexec/portzap/functions/requirements.sh
|
17
bin/portzap
17
bin/portzap
|
@ -1,39 +1,40 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
|
base_dir=$(dirname "$0")
|
||||||
ports_url="https://git.hardenedbsd.org/hardenedbsd/ports.git"
|
ports_url="https://git.hardenedbsd.org/hardenedbsd/ports.git"
|
||||||
ports_dir="/usr/ports/"
|
ports_dir="/usr/ports/"
|
||||||
portzap_file="$ports_dir/.portzap"
|
portzap_file="$ports_dir/.portzap"
|
||||||
portzap_dir="/home/_portzap/ports"
|
portzap_dir="/home/_portzap/ports"
|
||||||
libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/)
|
libexec_dir=$(realpath "$base_dir/../libexec/portzap/")
|
||||||
|
|
||||||
# Masks
|
# Masks
|
||||||
clone_mask=007
|
clone_mask=007
|
||||||
pull_mask=007
|
pull_mask=007
|
||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
. $libexec_dir/commands/portzap-install
|
. "$libexec_dir/commands/portzap-install"
|
||||||
. $libexec_dir/commands/portzap-pull
|
. "$libexec_dir/commands/portzap-pull"
|
||||||
. $libexec_dir/commands/portzap-clone
|
. "$libexec_dir/commands/portzap-clone"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
. $libexec_dir/functions/requirements.sh
|
. "$libexec_dir/functions/requirements.sh"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"clone")
|
"clone")
|
||||||
require_deps git
|
require_deps git
|
||||||
require_group _portzap
|
require_group _portzap
|
||||||
portzap_clone $portzap_dir $ports_url $clone_mask
|
portzap_clone "$portzap_dir" "$ports_url" "$clone_mask"
|
||||||
;;
|
;;
|
||||||
"pull")
|
"pull")
|
||||||
require_deps git
|
require_deps git
|
||||||
require_group _portzap
|
require_group _portzap
|
||||||
portzap_pull $portzap_dir $pull_mask
|
portzap_pull "$portzap_dir" "$pull_mask"
|
||||||
;;
|
;;
|
||||||
"install")
|
"install")
|
||||||
require_root
|
require_root
|
||||||
require_deps git
|
require_deps git
|
||||||
portzap_install $ports_dir $portzap_dir $libexec_dir $portzap_file
|
portzap_install "$ports_dir" "$portzap_dir" "$libexec_dir" "$portzap_file"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: portzap clone|pull|install"
|
echo "Usage: portzap clone|pull|install"
|
||||||
|
|
Loading…
Reference in a new issue