added some missing modules from initial commit
parent
d3b61e15b7
commit
8ffd43d25e
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
function get_platform () {
|
||||
|
||||
local OS
|
||||
local ARCH
|
||||
local PLATFORM
|
||||
|
||||
OS="$(uname -s)"
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
case $OS in
|
||||
"Linux")
|
||||
case $ARCH in
|
||||
"x86_64")
|
||||
ARCH=amd64
|
||||
;;
|
||||
"aarch64")
|
||||
ARCH=arm64
|
||||
;;
|
||||
"armv6")
|
||||
ARCH=armv6l
|
||||
;;
|
||||
"armv8")
|
||||
ARCH=arm64
|
||||
;;
|
||||
.*386.*)
|
||||
ARCH=386
|
||||
;;
|
||||
esac
|
||||
PLATFORM="linux-$ARCH"
|
||||
;;
|
||||
"Darwin")
|
||||
PLATFORM="darwin-amd64"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $PLATFORM
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
module_load confirm
|
||||
|
||||
rm_node_modules () {
|
||||
parent=${1:-$PWD}
|
||||
echo finding node_modules folders within $parent
|
||||
if command find . -name 'node_modules' -type d -prune 2>/dev/null;then
|
||||
confirm continue with deleting? || return 1
|
||||
command find . -name 'node_modules' -type d -prune -exec rm -r '{}' +
|
||||
else
|
||||
echo no folders to delete
|
||||
fi
|
||||
}
|
||||
|
||||
# if script was executed then call the function
|
||||
(return 0 2>/dev/null) || rm_node_modules $@
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
VSCODE_BIN=$(command -v code)
|
||||
VSCODE_BIN=${VSCODE_BIN:-$(command -v codium)}
|
||||
[[ $VSCODE_BIN ]] || {
|
||||
echo "no vscode binary on machine"
|
||||
exit
|
||||
}
|
||||
# set default home here
|
||||
# can pass
|
||||
vscode() {
|
||||
#local home=$HOME
|
||||
local home=/opt/vscode
|
||||
home=${VSCODE_HOME:-$home}
|
||||
[[ $1 == "-h" ]] && home=$2 && shift 2
|
||||
mkdir -p ${home}/${USER}
|
||||
[[ $? -ne 0 ]] && echo "unable to set vscode home at $home/$USER, aborting" && return 1
|
||||
exts=${home}/${USER}/extensions
|
||||
user=${home}/${USER}/data
|
||||
echo $VSCODE_BIN --user-data-dir=$user --extensions-dir=$exts "$@"
|
||||
$VSCODE_BIN --user-data-dir=$user --extensions-dir=$exts "$@"
|
||||
}
|
||||
|
||||
# # if script was executed then call the function
|
||||
(return 0 2>/dev/null) || vscode $@
|
Loading…
Reference in New Issue