npm version aliases added, npmpatch,npmmajor,npmminor

added force flag to golang install
remove all giskard references.  giskard stuff in giskard branch
trantor
Kebler Network System Administrator 2021-04-14 11:03:31 -07:00
parent 4821c4881a
commit dc6613ea0f
6 changed files with 32 additions and 27 deletions

View File

@ -24,15 +24,12 @@ root_command() {
local exclude=${args[--exclude_file]}
if [[ ! $exclude ]]; then
echo checking local excludes
[[ -f $source/exclude.bac ]] && exclude="$source/exclude.bac"
ls $source
# ls $source
# [[ $EXCLUDE_BACKUP ]] && exclude="$BACKUP_EXCLUDE"
fi
exclude=$([[ $exclude ]] && echo --exclude-globbing-filelist $exclude)
echo exclude file: $exclude
echo making exclude
[[ $exclude ]] && exclude="--exclude-globbing-filelist $exclude"
# local ssh="--remote-schema \"ssh -C %s /home/sysadmin/.local/bin/rdiff-backup --server\""

View File

@ -4,7 +4,6 @@ if command -v node >/dev/null 2>&1; then
# echo addding node langauge stuff
# gives access to packages with bin in a project
path_append ./node_modules/.bin
export NPM_REGISTRY=https://npm.kebler.net
alias nr="npm run"
alias nrs="npm -s run"
@ -45,8 +44,11 @@ alias npma="npm-add-dependencies"
# alias npmpub="npm publish --access public"
alias npmlrepub="npm publish --registry http://localhost:4873 --force --access restricted"
alias npmlpub="npm publish --registry http://localhost:4873 --access restricted"
alias npmnrepub="npm publish --registry https://npm.kebler.net --force --access restricted"
alias npmnpub="npm publish --registry https://npm.kebler.net --access restricted"
alias npmkrepub="npm version patch && npm publish --registry https://npm.kebler.net --access restricted"
alias npmkpub="npm publish --registry https://npm.kebler.net --access restricted"
alias npmpatch="npm version patch"
alias npmmajor="npm version major"
alias npmminor="npm version minor"
alias npmjspub="npm publish --registry https://registry.npmjs.org --access public"
alias yalcpush="nodemon -x 'yalc push'"

View File

@ -27,12 +27,12 @@ export PYENV_VERSION=3.8.7
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
path_append "/opt/python/apps/bin"
export PIPX_HOME=/opt/python/apps
export PIPX_BIN_DIR=$PIPX_HOME/bin
fi
spipua () {
module_load confirm
echo upgrading all base python packages - requires sudo access

View File

@ -49,11 +49,11 @@ golang_install () {
PLATFORM=$(get_platform)
if [ -z "$PLATFORM" ]; then
echo "Your operating system is not supported by this install script."
exit 1
return 1
fi
module_load block
[ ! "$(module_loaded block)" ] && echo unable to load block module, exiting && exit 1
[ ! "$(module_loaded block)" ] && echo unable to load block module, exiting && return 1
module_load confirm
declare ENV_TYPE="u" # Which shell repo for the block
@ -63,14 +63,18 @@ declare ENV_FILE # override shell repo location
# local versions of these
declare goroot
declare gopath
local force
declare OPTION
declare OPTARG
declare OPTIND
while getopts 'e:f:r:p:' OPTION; do
while getopts 're:f:r:p:' OPTION; do
# echo $OPTION $OPTARG
case "$OPTION" in
r)
force=true
;;
f)
ENV_FILE=$OPTARG
echo explicing setting block to $ENV_FILE
@ -98,7 +102,7 @@ shift $(( OPTIND - 1 ))
if [[ ! $ENV_FILE ]]; then
FILE=lang/go
case $ENV_TYPE in
# h=host n=network b=base
# h=host m=machine n=network b=base
"h")
[[ -d $BASH_SHELL_HOST/$(hostname) ]] && ENV_FILE=$BASH_SHELL_HOST/$(hostname)/$FILE
;&
@ -113,6 +117,7 @@ if [[ ! $ENV_FILE ]]; then
;;
esac
[[ ! $ENV_FILE ]] && ENV_FILE=$HOME/.bashrc # default is userspace
ENV_TYPE="u"
fi
if [[ ! $goroot ]]; then
@ -143,16 +148,16 @@ echo ==== envionrment block is ====
printf "${goenv[*]}\n"
echo =========================================
echo environment block file is $ENV_FILE
confirm Do you want to continue || exit 1
confirm Do you want to continue || return 1
set_block -f $ENV_FILE -n "Go Language Environment"
if [[ $1 = remove ]]; then
confirm Do you really want to remove the go installation? || exit
confirm Do you really want to remove the go installation? || return 1
remove_block
confirm Delete directory $gopath??? && rm -rf $gopath
confirm Delete directory $goroot??? && rm -rf $goroot
exit
return 1
fi
# the github api doesn't show any release records to had to grab this way
@ -162,14 +167,17 @@ if [[ $(which go) ]]; then
# INSTALLED_VERSION=1.15.2 # this is for testing, comment out for production
echo installed: $INSTALLED_VERSION available: $VERSION
if [ "$INSTALLED_VERSION" == "$VERSION" ]; then
if [[ ! $force ]]; then
echo Installed Version $INSTALLED_VERSION is current nothing to do, exiting
exit 0
echo use -r flag to force reinstall
return 2
fi
fi
fi
if [ -d "$goroot" ]; then
echo "The Go install directory ($goroot) already exists. "
confirm Do you want to upgrade to $VERSION? || exit
confirm Do you want to upgrade to $VERSION? || return 0
fi
echo installing version $VERSION ......
@ -186,14 +194,14 @@ fi
if [ $? -ne 0 ]; then
echo "Download failed! Exiting."
exit 1
return 1
fi
echo "Extracting File..."
mkdir -p "$goroot"
# TODO set correct permissions here if necessary
tar -C "$goroot" --strip-components=1 -xzf "$TEMP_DIRECTORY/go.tar.gz"
sudo tar -C "$goroot" --strip-components=1 -xzf "$TEMP_DIRECTORY/go.tar.gz"
echo done installing go binary and support files
@ -214,5 +222,6 @@ block_add_line "${goenv[*]}"
# echo ------------------------------------------------
echo -e "\nGo $VERSION was installed into $goroot.\n(re)start a new shell environment to take effect"
echo NOTE: all files have root:root user:group, run a chown/chmod/setfacl commands if need be
return 0
}

View File

@ -12,6 +12,5 @@ echo no folders to delete
fi
}
# if script was executed then call the function
(return 0 2>/dev/null) || rm_node_modules $@

View File

@ -1,2 +0,0 @@
echo setting up bindmounts for chromium
echo sudo -s "/bin/bash /opt/bin/bmount -u $USER -g users /mnt/common/home /mnt/AllData/tempbind"