Bug fixes

This commit is contained in:
Charles Thorley 2013-12-12 18:18:16 -08:00
parent ef890addac
commit f26686a9fc
2 changed files with 20 additions and 14 deletions

View File

@ -3,9 +3,10 @@ function mark
command ln -s (pwd) $MARKPATH/$argv[1]
else if test (count $argv) -eq 2
if test -d $argv[2]
set -l current_dir (pwd)
cd $argv[2]
command ln -s (pwd) $MARKPATH/$argv[1]
cd -
cd $current_dir
else
echo "$argv[2] is not a valid directory."
end

View File

@ -2,21 +2,26 @@ function marks
if test (count $argv) -gt 0
echo "Usage: marks"
else
set -l file_list (command ls $MARKPATH/)
set -l mark_list
for file in $file_list
if test -d $MARKPATH/$file -a -L $MARKPATH/$file
set mark_list $mark_list $file
end
end
if test (count $mark_list) -eq 0
set -l file_list (command ls $MARKPATH)
if test (count $file_list) -eq 0
echo "No marks currently defined."
else
for mark_name in $mark_list
cd $MARKPATH/$mark_name
set -l real_path (pwd)
cd -
echo "$mark_name -> $real_path"
set -l mark_list
for file in $file_list
if test -d $MARKPATH/$file -a -L $MARKPATH/$file
set mark_list $mark_list $file
end
end
if test (count $mark_list) -eq 0
echo "No marks currently defined."
else
set -l current_dir (pwd)
for mark_name in $mark_list
cd $MARKPATH/$mark_name
set -l real_path (pwd)
echo "$mark_name -> $real_path"
end
cd $current_dir
end
end
end