This commit is contained in:
Brian Zalewski 2023-07-17 22:06:36 +00:00
parent 27e3cd3388
commit c39546d19a
6 changed files with 19 additions and 21 deletions

View file

@ -23,12 +23,12 @@ if command -v netdata-claim.sh > /dev/null; then
fi fi
### Ensure /usr/local/var/lib/netdata/cloud.d is owned by user ### Ensure /usr/local/var/lib/netdata/cloud.d is owned by user
if [ -d /usr/local/var/lib/netdata/cloud.d ]; then if [ -d /usr/local/var/lib/netdata ]; then
logg info 'Ensuring permissions are correct on /usr/local/var/lib/netdata/cloud.d' logg info 'Ensuring permissions are correct on /usr/local/var/lib/netdata'
sudo chown -Rf $USER /usr/local/var/lib/netdata/cloud.d sudo chown -Rf netdata:netdata /usr/local/var/lib/netdata
elif [ -d /var/lib/netdata/cloud.d ]; then elif [ -d /var/lib/netdata ]; then
logg info 'Ensuring permissions are correct on /var/lib/netdata/cloud.d' logg info 'Ensuring permissions are correct on /var/lib/netdata'
sudo chown -Rf $USER /var/lib/netdata/cloud.d sudo chown -Rf netdata:netdata /var/lib/netdata
fi fi
# netdata-claim.sh must be run as netdata user # netdata-claim.sh must be run as netdata user

View file

@ -57,9 +57,7 @@ if command -v powerline > /dev/null && [ -f "$HOME/.bashrc" ]; then
### Ensure plugins are enabled ### Ensure plugins are enabled
logg info 'Enabling bash-it plugins' logg info 'Enabling bash-it plugins'
# TODO: Move these plugins to the .chezmoidata.yaml # TODO: Move these plugins to the .chezmoidata.yaml
# Plugin: xterm causing following error so it was removed for PLUGIN in base blesh browser cht-sh dirs gitstatus powerline sudo xterm; do
# ble: Please run `stty sane' to recover the correct TTY state.
for PLUGIN in base blesh browser cht-sh dirs gitstatus powerline sudo; do
if ls "$BASH_IT/enabled" | grep "$PLUGIN" > /dev/null; then if ls "$BASH_IT/enabled" | grep "$PLUGIN" > /dev/null; then
rm -f "$BASH_IT/enabled/"*"$PLUGIN"* > /dev/null && logg info "Removed old $PLUGIN bash-it plugin symlink" || logg error "Failed to remove $PLUGIN bash-it plugin symlink" rm -f "$BASH_IT/enabled/"*"$PLUGIN"* > /dev/null && logg info "Removed old $PLUGIN bash-it plugin symlink" || logg error "Failed to remove $PLUGIN bash-it plugin symlink"
fi fi
@ -68,6 +66,7 @@ if command -v powerline > /dev/null && [ -f "$HOME/.bashrc" ]; then
else else
logg warn 'The path specified by BASH_IT does not exist yet' logg warn 'The path specified by BASH_IT does not exist yet'
fi fi
exit 0
else else
if ! command -v powerline > /dev/null; then if ! command -v powerline > /dev/null; then
logg warn '`powerline` is not available' logg warn '`powerline` is not available'

View file

@ -248,13 +248,13 @@ if command -v cloudflared > /dev/null && [ -d "$HOME/.local/etc/cloudflared" ];
sudo cp -f "$HOME/.local/etc/cloudflared/config.yml" /usr/local/etc/cloudflared/config.yml sudo cp -f "$HOME/.local/etc/cloudflared/config.yml" /usr/local/etc/cloudflared/config.yml
# Register tunnel (if not already registered) # Register tunnel (if not already registered)
if cloudflared tunnel list | grep "host-{{ .host.hostname }}"; then if sudo cloudflared tunnel list | grep "host-{{ .host.hostname }}" > /dev/null; then
logg info 'CloudFlare tunnel is already registered' logg info 'CloudFlare tunnel is already registered'
else else
logg info 'Creating a CloudFlare tunnel to this host' logg info 'Creating a CloudFlare tunnel to this host'
sudo cloudflared tunnel create "host-{{ .host.hostname }}" sudo cloudflared tunnel create "host-{{ .host.hostname }}"
fi fi
TUNNEL_ID="$(cloudflared tunnel list | grep "host-{{ .host.hostname }}" | sed 's/ .*//')" TUNNEL_ID="$(sudo cloudflared tunnel list | grep "host-{{ .host.hostname }}" | sed 's/ .*//')"
logg info "Tunnel ID: $TUNNEL_ID" logg info "Tunnel ID: $TUNNEL_ID"
if [ -f "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" ]; then if [ -f "/usr/local/etc/cloudflared/${TUNNEL_ID}.json" ]; then
logg info 'Symlinking tunnel configuration to /usr/local/etc/cloudflared/credentials.json' logg info 'Symlinking tunnel configuration to /usr/local/etc/cloudflared/credentials.json'

View file

@ -22,6 +22,11 @@ if [ -f /etc/bashrc ]; then
. /etc/bashrc . /etc/bashrc
fi fi
### Java (asdf)
if [ -f "$ASDF_DATA_DIR/plugins/java/set-java-home.bash" ]; then
. "$ASDF_DATA_DIR/plugins/java/set-java-home.bash"
fi
### Escape if shell not interactive ### Escape if shell not interactive
case $- in case $- in
*i*) ;; *i*) ;;
@ -111,11 +116,6 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
. "$HOME/.local/scripts/iterm2.bash" . "$HOME/.local/scripts/iterm2.bash"
fi fi
### Java (asdf)
if [ -f "$ASDF_DATA_DIR/plugins/java/set-java-home.bash" ]; then
. "$ASDF_DATA_DIR/plugins/java/set-java-home.bash"
fi
### Fig ### Fig
if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then
. "$HOME/.fig/shell/bashrc.post.bash" . "$HOME/.fig/shell/bashrc.post.bash"

View file

@ -766,7 +766,7 @@ async function beforeInstall(packageManager) {
log('error', 'Homebrew', 'Failed running brew update / upgrade') log('error', 'Homebrew', 'Failed running brew update / upgrade')
log('info', 'Homebrew', 'Running brew tap --repair and trying again') log('info', 'Homebrew', 'Running brew tap --repair and trying again')
try { try {
runCommand('Repairing taps and retrying brew update / upgrade', 'brew tap --repair && brew update && brew upgrade --cask --greedy && brew upgrade --force --greedy') runCommand('Repairing taps and retrying brew update / upgrade', 'rm -rf $(brew --cache) && brew tap --repair && brew update && brew upgrade --cask --greedy && brew upgrade --force --greedy')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
log('error', 'Homebrew', 'Failed both attempts to run brew update / upgrade') log('error', 'Homebrew', 'Failed both attempts to run brew update / upgrade')
@ -1717,7 +1717,7 @@ async function pruneInstallOrders(installOrders) {
try { try {
await $`cat ${pkgTmp} | grep '^${pkg}$'` await $`cat ${pkgTmp} | grep '^${pkg}$'`
log('info', 'Filter', 'Filtering list') log('info', 'Filter', 'Filtering list')
newVal = newVal.filter((x) => x === pkg) newVal = newVal.filter((x) => x !== pkg)
console.log('New list', newVal) console.log('New list', newVal)
} catch (e) { } catch (e) {
// Do nothing // Do nothing

View file

@ -723,7 +723,7 @@ softwarePackages:
catlight: catlight:
_github: https://github.com/catlightio/CatLight _github: https://github.com/catlightio/CatLight
_name: Catlight _name: Catlight
when: '! test -d /Applications/Catlight.app && ! test -d $HOME/Applications/Catlight.app' _when: '! test -d /Applications/Catlight.app && ! test -d "$HOME/Applications/Catlight.app"'
cask: catlight cask: catlight
deb: https://catlight.io/downloads/linux/beta deb: https://catlight.io/downloads/linux/beta
d2vm: d2vm:
@ -2887,13 +2887,13 @@ softwarePackages:
snap: ffsend snap: ffsend
yay: ffsend yay: ffsend
fig: fig:
_bin: fig
_desc: '[Fig](https://fig.io/) adds autocomplete to your terminal. As you type, Fig pops up subcommands, options, and contextually relevant arguments in your existing terminal.' _desc: '[Fig](https://fig.io/) adds autocomplete to your terminal. As you type, Fig pops up subcommands, options, and contextually relevant arguments in your existing terminal.'
_docs: https://fig.io/user-manual _docs: https://fig.io/user-manual
_github: https://github.com/withfig/autocomplete _github: https://github.com/withfig/autocomplete
_home: https://fig.io/ _home: https://fig.io/
_name: Fig _name: Fig
_when:cask: '! test -d "/Applications/Fig.app" && ! test -d "$HOME/Applications/Fig.app"' _when:cask: '! test -d "/Applications/Fig.app" && ! test -d "$HOME/Applications/Fig.app"'
ansible:darwin: professormanhattan.fig
cask: fig cask: fig
steampipe: steampipe:
_bin: steampipe _bin: steampipe
@ -4495,7 +4495,6 @@ softwarePackages:
_github: https://github.com/ipfs/ipfs _github: https://github.com/ipfs/ipfs
_home: https://ipfs.tech/ _home: https://ipfs.tech/
_name: IPFS _name: IPFS
_service: ipfs
brew: ipfs brew: ipfs
choco: go-ifps choco: go-ifps
nix: ipfs nix: ipfs