Skip to content

Commit

Permalink
git-pull-subdirectories, minor fish cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfallshaw committed Jul 4, 2019
1 parent 5d3f93e commit 8a20399
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
3 changes: 1 addition & 2 deletions config/fish/functions/cdd.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# cd into ~/code
function cdd
function cdd -d "cd into ~/code"
set -l cdpath "$HOME/code"
if [ -z "$argv[1]" ]
cd $cdpath
Expand Down
3 changes: 1 addition & 2 deletions config/fish/functions/cde.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# cd into ~/eclipse-workspace
function cde
function cde -d "cd into ~/eclipse-workspace"
set -l cdpath "$HOME/eclipse-workspace"
if [ -z "$argv[1]" ]
cd $cdpath
Expand Down
3 changes: 1 addition & 2 deletions config/fish/functions/cds.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# cd into ~/source
function cds
function cds -d "cd into ~/source"
set -l cdpath "$HOME/source"
if [ -z "$argv[1]" ]
cd $cdpath
Expand Down
3 changes: 1 addition & 2 deletions config/fish/functions/cdup.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# cd up n directories
function cdup
function cdup -d "cd up n directories"
set -l ups ""
for i in (seq 1 $argv[1])
set ups $ups"../"
Expand Down
2 changes: 1 addition & 1 deletion config/fish/functions/gco.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function gco
function gco -d "`git checkout [master | arg`"
if [ -z "$argv[1]" ]; then
git checkout master
else
Expand Down
18 changes: 18 additions & 0 deletions config/fish/functions/git-pull-subdirectories.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function git-pull-subdirectories -d "`git pull` all subdirectories of pwd"
echo 'Pulling subdirectories...'
set -l start_dir (pwd)
for d in (ls -d */)
echo $d
cd $d
if test -d .git
git pull
else
echo "Not a git repo"
end
cd $start_dir
echo
echo
echo
end
and echo 'Finished.'
end
3 changes: 1 addition & 2 deletions config/fish/functions/mcd.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Make a directory and cd into it
function mcd
function mcd -d "Make a directory and cd into it"
mkdir -p "$argv[1]"; and cd "$argv[1]"
end
3 changes: 1 addition & 2 deletions config/fish/functions/mtd.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Make a temp directory and cd into it
function mtd
function mtd -d "Make a temp directory and cd into it"
set -l dir (mktemp -d)
if test -n "$dir"
if test -d "$dir"
Expand Down

0 comments on commit 8a20399

Please sign in to comment.