parent
64ff921a36
commit
44fff79e61
@ -1,3 +0,0 @@
|
||||
function wh {
|
||||
source <(python3 /home/glmdev/Projects/do_what/do_what.py $*)
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
function wh
|
||||
python3 /home/glmdev/Projects/do_what/do_what.py $argv | .
|
||||
end
|
@ -0,0 +1,16 @@
|
||||
import sys
|
||||
|
||||
if ( len(sys.argv) > 1 ):
|
||||
shell = sys.argv[1]
|
||||
if ( shell == "fish" ):
|
||||
print("function wh")
|
||||
print(" set -x DO_WHAT_SHELL fish")
|
||||
print(" python3 "+interpreter_location+" $argv | .")
|
||||
print("end")
|
||||
elif ( shell == "bash" or shell == "zsh" ):
|
||||
print("function wh {")
|
||||
print(" export DO_WHAT_SHELL="+shell)
|
||||
print(" source <(python3 "+interpreter_location+" $*)")
|
||||
print("}")
|
||||
else:
|
||||
print("No shell specified.")
|
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
INSTALL_DIR=$(readlink -f $1)
|
||||
|
||||
# Make the installation directory
|
||||
mkdir -p $INSTALL_DIR/do_what
|
||||
mkdir -p $INSTALL_DIR/bin
|
||||
|
||||
cp ./do_what.py $INSTALL_DIR/do_what/interpreter.py
|
||||
|
||||
echo "#!/usr/bin/env python3" > $INSTALL_DIR/do_what/dowhat
|
||||
echo "interpreter_location=\"$INSTALL_DIR/do_what/interpreter.py\"" >> $INSTALL_DIR/do_what/dowhat
|
||||
cat ./do_what_aliaser.py >> $INSTALL_DIR/do_what/dowhat
|
||||
|
||||
ln -s $INSTALL_DIR/do_what/dowhat $INSTALL_DIR/bin/dowhat
|
||||
chmod +x $INSTALL_DIR/do_what/dowhat
|
||||
|
||||
echo "End."
|
Loading…
Reference in new issue