Last active
August 29, 2015 14:26
-
-
Save olls/55cdf3f03f763d261451 to your computer and use it in GitHub Desktop.
Project Initialiser
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 pro | |
set name $argv[1] | |
mkdir $name | |
if test $status = 0 | |
cd $name | |
git init | |
printf (echo $name | sed -e 's/^./\U&/' | tr _ ' ' | tr '-' ' ')\n(head -c (expr length + $name) < /dev/zero | tr '\0' '=')\n > README.md | |
set subl_dir /home/olls/.config/sublime-text-3 | |
cp $subl_dir/default.sublime-project $name.sublime-project | |
# Add project to library.json | |
set temp tmp-lib.json | |
head -n1 $subl_dir/Packages/User/Projects/library.json >> $temp | |
printf \t\"(pwd)/$name.sublime-project\",\n >> $temp | |
tail -n +2 $subl_dir/Packages/User/Projects/library.json >> $temp | |
mv $temp $subl_dir/Packages/User/Projects/library.json | |
subl --project $name.sublime-project | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/6537490/insert-a-line-at-specific-line-number-with-sed-or-awk