Skip to content

Commit

Permalink
added deb build support
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodsr committed May 9, 2020
1 parent f983e61 commit aa55294
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
13 changes: 13 additions & 0 deletions build/build-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
BASEDIR=$(dirname $0)
echo "cleanup : $BASEDIR/../out"
rm $BASEDIR/../out/*
echo "build:go"
go build -o $BASEDIR/../out/shell-butler $BASEDIR/../main.go
echo "cp: binary"
#mkdir -p $BASEDIR/../package/debian/shell-butler/usr/local/bin
mkdir -p $BASEDIR/../package/debian/shell-butler/opt/shell-butler/bin
cp $BASEDIR/../run $BASEDIR/../package/debian/shell-butler/opt/shell-butler/bin/shell-butler-run
cp $BASEDIR/../out/shell-butler $BASEDIR/../package/debian/shell-butler/opt/shell-butler/bin
echo "run: dpkg-deb"
dpkg-deb --build $BASEDIR/../package/debian/shell-butler $BASEDIR/../out/shell-butler.deb
echo "done"
9 changes: 9 additions & 0 deletions package/debian/shell-butler/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: shell-butler
Version: 1.0.2
Section: custom
Priority: optional
Architecture: all
Essential: no
Installed-Size: 1024
Maintainer: Vinod S R <[email protected]>
Description: Your butler to run frequent commands in linux
Binary file not shown.
22 changes: 22 additions & 0 deletions package/debian/shell-butler/opt/shell-butler/bin/shell-butler-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
SCRIPT=`realpath $0`
BASEDIR=$(dirname $SCRIPT)
if [ "$1" = "add" ]; then
${BASEDIR}/shell-butler $*
else

result=$(${BASEDIR}/shell-butler $*)
ret=$?

echo -e "\U1F916 Hey"
if [ $ret -eq 0 ]; then
echo
echo -e "\U1F3C3 : $result"
echo
eval $result
else
echo
echo -e "\U2757 You haven't selected any command"
echo
fi
fi
2 changes: 2 additions & 0 deletions package/debian/shell-butler/usr/bin/shell-butler
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Run using the current shell context
source "/opt/shell-butler/bin/shell-butler-run"
14 changes: 8 additions & 6 deletions run
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
BASEDIR=$(dirname $0)
#!/bin/bash
SCRIPT=`realpath $0`
BASEDIR=$(dirname $SCRIPT)
if [ "$1" = "add" ]; then
shell-butler $*
${BASEDIR}/shell-butler $*
else

result=$(shell-butler $*)
result=$(${BASEDIR}/shell-butler $*)
ret=$?

echo "\U1F916 Hey"
echo -e "\U1F916 Hey"
if [ $ret -eq 0 ]; then
echo
echo "\U1F3C3 : $result"
echo -e "\U1F3C3 : $result"
echo
eval $result
else
echo
echo "\U2757 You haven't selected any command"
echo -e "\U2757 You haven't selected any command"
echo
fi
fi

0 comments on commit aa55294

Please sign in to comment.