Update vscode.inst, link directoy to /opt/bin instead of copy to host
parent
4e015546ea
commit
95beb818d0
|
@ -2,34 +2,22 @@
|
||||||
|
|
||||||
# make generic for an app
|
# make generic for an app
|
||||||
function vscode_install {
|
function vscode_install {
|
||||||
BASH_SHELL_HOST=${BASH_SHELL_HOST:-$(dirname $BASH_SHELL_BASE)/$(hostname)}
|
|
||||||
mkdir -p $BASH_SHELL_HOST/apps
|
|
||||||
local src
|
local src
|
||||||
local target
|
local target
|
||||||
local dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
|
local dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
|
||||||
local script=$dir/vscode.func
|
local script=$dir/vscode.func
|
||||||
# todo call distro specific install
|
[[ ! $(command -v code) ]] && echo "vscode binary (code) at must be installed first" && return 1
|
||||||
[[ ! -f $script ]] && echo can not find script chromium function $script && return 2
|
[[ ! -f $script ]] && echo can not find vscode function script at $script && return 2
|
||||||
src=$BASH_SHELL_HOST/apps/vscode
|
|
||||||
echo installing vscode to $src
|
|
||||||
cp $script $src
|
|
||||||
target=${1:-/opt/bin}/vscode
|
target=${1:-/opt/bin}/vscode
|
||||||
chmod +rx $src
|
chmod +rx $script
|
||||||
ln -sf $src $target
|
ln -sf $script $target
|
||||||
echo link to $src created at $target
|
echo link to $script created at $target
|
||||||
ls -la /opt/bin | grep vscode
|
ls -la /opt/bin | grep vscode
|
||||||
echo with permissions
|
echo with permissions
|
||||||
ls -la $src
|
ls -la $script
|
||||||
}
|
}
|
||||||
|
|
||||||
code_install_deb() {
|
|
||||||
sudo apt-get install wget gpg
|
|
||||||
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg
|
|
||||||
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
|
|
||||||
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
|
|
||||||
rm -sudo apt update
|
|
||||||
sudo apt install code # or code-insiders
|
|
||||||
}
|
|
||||||
|
|
||||||
# if script was executed then call the function
|
# if script was executed then call the function
|
||||||
(return 0 2>/dev/null) || vscode_install $@
|
(return 0 2>/dev/null) || vscode_install $@
|
||||||
|
|
Loading…
Reference in New Issue