Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
035c1262
Commit
035c1262
authored
Apr 23, 2017
by
alexandre.jauneau
Browse files
Create some aliases to facilitate the development
parent
f323c805
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/dev.sh
0 → 100755
View file @
035c1262
#!/bin/bash
# Script to setup few usual aliases to facilitate the development
# This aliases should work if you've installed memopol throught the quickstart
# script or the documentation
# It :
# - Setup automaticaly the venv
# - Setup Django in DEBUG mode
# You just need to add a line in you're .bashrc or .zshrc to load them:
REPOROOT
=
"
$(
readlink
-m
"
${
BASH_SOURCE
[0]
}
"
/../..
)
"
ALIASROOT
=
$REPOROOT
"/.memopol.alias"
echo
$ALIASROOT
echo
"Create a dedicated alias file in
$ALIASROOT
"
echo
"alias memopol-code=
\"
cd
$REPOROOT
&& source
$REPOROOT
/memopol_env/bin/activate && DJANGO_DEBUG=True
\"
"
>
$ALIASROOT
echo
"alias memopol-launch=
\"
memopol-code && memopol runserver
\"
"
>>
$ALIASROOT
echo
"alias memopol-update-all=
\"
memopol-code && bin/update-all
\"
"
>>
$ALIASROOT
echo
"alias memopol-refresh-scores=
\"
memopol-code && memopol refresh_scores
\"
"
>>
$ALIASROOT
if
[
$SHELL
=
"/bin/bash"
]
then
echo
"Bash detected"
echo
"Update
$HOME
/.bashrc file"
RCSHELL
=
"
$HOME
/.bashrc"
elif
[
$SHELL
=
"/bin/zsh"
]
then
echo
"Zsh detected"
echo
"Update
$HOME
/.zshrc file"
RCSHELL
=
"
$HOME
/.zshrc"
else
echo
"SHELL don't supported. Try using BASH or ZSH, or manually."
fi
echo
"source
$ALIASROOT
"
>>
$RCSHELL
source
$ALIASROOT
echo
-e
"You can use the following aliases :
\n
"
echo
-e
"
\t
memopol-code : Go into the repository and activate the virtualenv"
echo
-e
"
\t
memopol-launch : Run the development server"
echo
-e
"
\t
memopoll-update-all : Get all the production data"
echo
-e
"
\t
memopol-refresh-scores : Refresh all scores"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment