Last active
December 19, 2015 09:09
-
-
Save apage43/5930850 to your computer and use it in GitHub Desktop.
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
function newns { | |
if [ ! -e project.clj ]; then | |
echo "Not in a project directory." | |
return 1 | |
fi | |
local filename=src/$(echo $1 | tr .- /_).clj | |
local dir=$(dirname $filename) | |
mkdir -p $dir | |
if [ ! -e $filename ]; then | |
echo "(ns $1)" > $filename | |
else | |
echo "File $filename already exists." | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment