Something went wrong. Try again.
My personal Linux user configuration
linux dotfiles linux-dotfiles dots
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677#!/usr/bin/env sh
usage() { 1>&2 printf -- 'Usage: %s [-hrf]\n' "$0" 1>&2 printf -- '\t-h: Show help menu\n' 1>&2 printf -- '\t-r: Refresh repository\n' 1>&2 printf -- '\t-x: Install VSCodium extensions\n' 1>&2 printf -- '\t-f: Force install\n'}
unset REFRESH CODIUM_EXTENSIONS FORCEcd "$(dirname "$0")" || exit 1
while getopts "hrxf" opt; do case "$opt" in h) usage exit 0 ;; r) REFRESH=1 ;; x) CODIUM_EXTENSIONS=1 ;; f) FORCE=1 ;; *) usage exit 1 ;; esacdone
install_codium_extensions() { if command -v codium >/dev/null; then printf '%s\n' 'Installing VSCodium extensions...' grep -v '^ *#' <.config/VSCodium/extensions.txt | while IFS= read -r line; do printf '%s\n' "$line" codium --install-extension "$line" >/dev/null done else printf '%s\n' 'VSCodium is not installed' fi}
install_dots() { rsync --exclude-from=.bootstrapignore -avgh --no-perms . "$HOME" || { printf '%s\n' 'rsync failed; aborted' >&2 exit 1 }}
if [ "$REFRESH" ]; then git pull --recurse-submodulesfi
if [ "$CODIUM_EXTENSIONS" ]; then install_codium_extensions exitfi
if [ "$FORCE" ]; then install_dotselse printf '%s' 'This may overwrite the existing configuration. Are you sure? [y/N] ' read -r REPLY case "$REPLY" in [Yy]) install_dots ;; *) exit 1 ;; esacfi
unset REFRESH FORCE CODIUM_EXTENSIONS install_codium_extensions install_dots