mirror of
https://github.com/mentos1386/dotfiles.git
synced 2024-11-25 16:55:43 +00:00
39 lines
673 B
Bash
Executable file
39 lines
673 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
ACTION=
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--install)
|
|
ACTION=install
|
|
break
|
|
shift
|
|
;;
|
|
--store)
|
|
ACTION=store
|
|
break
|
|
shift
|
|
;;
|
|
-h | --help)
|
|
echo "Usage: vscode.sh [--install|--store]"
|
|
exit 0
|
|
;;
|
|
-* | --*)
|
|
echo "Unknown option $1"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
if [ -z "$ACTION" ]; then
|
|
echo "No action specified"
|
|
echo "Usage: vscode.sh [--install|--store]"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$ACTION" = "install" ]; then
|
|
for extension in $(cat code/extensions.txt); do
|
|
code --install-extension $extension
|
|
done
|
|
elif [ "$ACTION" = "store" ]; then
|
|
code --list-extensions >code/extensions.txt
|
|
fi
|