Skip to content

Commit

Permalink
Create brew-export
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkmmr69420 authored Apr 11, 2024
1 parent 13f10d8 commit fbcf9bb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions bin/brew-export
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Initialize variables with default values
binpath=/home/linuxbrew/.linuxbrew/bin

# Parse flags
while getopts ":vi:o:" opt; do
case ${opt} in
s )
brewpath=/home/linuxbrew/.linuxbrew/sbin
;;
R )
root=true
;;
\? )
echo "Invalid option: $OPTARG" 1>&2
exit 1
;;
: )
echo "Option -$OPTARG requires an argument" 1>&2
exit 1
;;
esac
done
shift $((OPTIND -1))

bin=$1

if [ "$root" = "true" ]; then
distrobox-export --bin $brewpath/$bin --export-path $HOME/.local/share/clinuxbrew/exports/bin
else
distrobox-export --bin $brewpath/$bin --export-path $HOME/.local/share/clinuxbrew/exports/bin
fi

0 comments on commit fbcf9bb

Please sign in to comment.