package and script updates

This commit is contained in:
Noah Masur
2021-04-28 08:58:14 -04:00
parent 5d04fad4c9
commit c81827ef95
13 changed files with 63 additions and 12 deletions

View File

@ -46,24 +46,24 @@ use_fish_shell() {
exit 1
fi
FISH_SHELL=$(which fish)
if ! (cat /etc/shells | grep $FISH_SHELL > /dev/null)
if ! (grep "$FISH_SHELL" /etc/shells > /dev/null)
then
echo "Modifying /etc/shells"
echo "Requires sudo password"
sudo echo $FISH_SHELL >> /etc/shells
echo "$FISH_SHELL" | sudo tee -a /etc/shells
fi
if ! (echo "$SHELL" | grep fish > /dev/null)
then
echo "Changing default shell to fish"
echo "Requires sudo password"
sudo chsh -s $FISH_SHELL
sudo chsh -s "$FISH_SHELL"
fi
echo "fish ✓"
}
setup_poetry() {
poetry completions fish > $(brew --prefix)/share/fish/vendor_completions.d/poetry.fish
poetry completions fish > "$(brew --prefix)/share/fish/vendor_completions.d/poetry.fish"
}
printf "\nbootstrapping...\n\n"
@ -76,8 +76,9 @@ use_fish_shell
echo ""
echo "consider running other scripts:"
echo " - all_brews"
echo " - install_casks"
echo " - brews"
echo " - casks"
echo " - configure_macos"
echo " - install_rust"
echo " - rust"
echo " - cargos"
echo ""

View File

@ -5,7 +5,6 @@ cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
DOTS="$PWD"
all_brews() {
brewfile=$DOTS/homebrew/Caskfile
for brewfile in $(find "$DOTS/homebrew" -iname "*.Brewfile")
do
/usr/local/bin/brew bundle check --file "$brewfile" \

26
scripts/cargos Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
DOTS=$(dirname "$0")/..
cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
DOTS="$PWD"
check_rust() {
if ! (which ~/.cargo/bin/rustup > /dev/null)
then
echo "Install rust (cargo) before continuing"
echo "Run the rust script before this one"
exit 1
fi
}
all_cargos() {
cargofile=$DOTS/cargo/Cargofile
sed 's/#.*$//g;/^$/d' "$cargofile" | while read -r line
do
cargo install "$line"
done \
&& echo "all cargos installed ✓"
}
check_rust
all_cargos

View File

@ -29,12 +29,12 @@ download_rust_analyzer() {
echo "rust-analyzer ✓"
}
# cargo-edit: quickly add and remove packages
# whatfeatures: see optional features for a package
install_cargos() {
set -- \
'cargo-edit'
'cargo-whatfeatures' \
'jql' \
'toml-cli'
'cargo-edit' \
'cargo-whatfeatures'
for program do
cargo install "$program"
done