Skip to content

Instantly share code, notes, and snippets.

@6220119
Forked from mvllow/extract-vsix.sh
Created May 26, 2023 05:07
Show Gist options
  • Save 6220119/81bc6326e1d4eed6ecd66fb47ef71acc to your computer and use it in GitHub Desktop.
Save 6220119/81bc6326e1d4eed6ecd66fb47ef71acc to your computer and use it in GitHub Desktop.
# Usage:
# cd Downloads
# sh extract-vsix.sh mvllow.rose-pine-0.3.5
# ^ do not include .vsix
path="$1"
name="$(basename -- $1)"
out_dir=~/.vscode/extensions
tmp_dir=$(mktemp -d -t mvllow-dots)
mkdir -p "$out_dir"
mv "$path".vsix "$tmp_dir/$name".zip
unzip -d "$tmp_dir/$name-extra" "$tmp_dir/$name".zip &>/dev/null;
mv "$tmp_dir/$name-extra/extension" "$out_dir/$name"
rm -rf $tmp_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment