-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mepo3 related changes in pyproject.toml and src/mepo3/__main__.py. Al…
…so added etc/mepo3-cd.bash
- Loading branch information
1 parent
81d425b
commit 8b83441
Showing
3 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function usage_ () { | ||
echo "usage: " | ||
echo " mepo3-cd : cd to root of mepo3 project" | ||
echo " mepo3-cd <component> : cd to directory of <component>" | ||
echo "" | ||
echo "mepo3-cd accepts only 0 or 1 arguments" | ||
} | ||
|
||
function mepo3-cd () { | ||
if [ "$#" -gt 1 ]; then | ||
usage_ | ||
return 1 | ||
fi | ||
if [ "$1" == "-h" ]; then | ||
usage_ | ||
return 0 | ||
fi | ||
if [ "$#" -eq 0 ]; then | ||
output=$(python -m mepo3 whereis _root) | ||
else | ||
output=$(python -m mepo3 whereis -i $1) | ||
fi | ||
if [ $? -eq 0 ]; then | ||
cd $output | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters