Skip to content

Instantly share code, notes, and snippets.

@apage43
Last active December 19, 2015 09:09
Show Gist options
  • Save apage43/5930850 to your computer and use it in GitHub Desktop.
Save apage43/5930850 to your computer and use it in GitHub Desktop.
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