Skip to content

Commit

Permalink
simplify install script, add post install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
technocake committed May 16, 2019
1 parent 472bf13 commit 38efc65
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 129 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1,3 +1,3 @@
include README.md
include POST_INSTALL_INSTRUCTIONS.txt
include goto/*.py
include bin
10 changes: 10 additions & 0 deletions POST_INSTALL_INSTRUCTIONS.txt
@@ -0,0 +1,10 @@
Congratulations - you got goto!

Now there is one last step to let it do it's magic, always.


run this command:
install_goto


(Or you could manually add this to your .rc file: source start_goto)
58 changes: 58 additions & 0 deletions bin/install_goto
@@ -0,0 +1,58 @@
#!/bin/bash
. _gotoutils # load common utils



echo Step 1: Setting up magic data folder in ${HOME}/.goto
MAGICPATH="${HOME}/.goto"
if [[ ! -d "$MAGICPATH" ]]; then
mkdir "${HOME}/.goto" || check_status
mkdir "${HOME}/.goto/projects" || check_status
touch "${HOME}/.goto/active-project" || check_status
fi


echo Step 2: add goto startup script to bash config file
if [ -f "${HOME}/.bash_profile" ]; then
echo
echo "Next step is required to make goto work:"
echo

if prompt "Add goto startup script to .bash_profile? [y|n]: "; then
echo
echo "source start_goto" >> "${HOME}/.bash_profile" || check_status
else
echo
echo "If you want to do this manually add the line 'source start_goto' to your .bash_profile"
fi
else
echo "~/.bash_profile does not exist"
echo
echo "To make goto function properly, add this line to your bash config file: "
echo
echo " source start_goto"
echo
echo "into one of these (.bashrc | .profile | .bash_profile)"

if prompt "Want to append to .bashrc? [y|n]: "; then
echo "source start_goto" >> "${HOME}/.bashrc" || check_status
fi

fi


# make goto ready -- now.
source start_goto || check_status

# add your first project
project add goto || check_status

# set the context to this project
project goto || check_status

# add your first shortcuts
goto add goto https://github.com/technocake/goto || check_status
goto add github https://github.com/technocake/goto || check_status


echo Installation Succesful!
128 changes: 0 additions & 128 deletions install.sh

This file was deleted.

6 changes: 6 additions & 0 deletions setup.py
Expand Up @@ -3,6 +3,10 @@
with open("README.md", "r") as fh:
long_description = fh.read()

with open("POST_INSTALL_INSTRUCTIONS.txt", "r") as fh:
post_install_instructions = fh.read()


setuptools.setup(
name="goto",
version="1.3.0",
Expand All @@ -18,6 +22,7 @@
'bin/project',
'bin/_gotoutils',
'bin/start_goto',
'bin/install_goto',
],
entry_points={
'console_scripts': ['the_real_goto.py=goto.the_real_goto:main']
Expand All @@ -29,3 +34,4 @@
],
)

print(post_install_instructions)

0 comments on commit 38efc65

Please sign in to comment.