output to stderr, check if directory exists
This commit is contained in:
parent
1e2a7faa3c
commit
6cd79838c6
1 changed files with 9 additions and 2 deletions
|
@ -8,6 +8,13 @@ function makeaway
|
|||
return 0
|
||||
end
|
||||
|
||||
# Check if directory exists
|
||||
set directory $argv[1]
|
||||
if not test -d $directory
|
||||
echo "Directory doesn't exists." 1>&2
|
||||
return 1
|
||||
end
|
||||
|
||||
# Find the target
|
||||
set target ""
|
||||
if test (count $argv) -ge 3 && test "$argv[2]" = --
|
||||
|
@ -15,12 +22,12 @@ function makeaway
|
|||
set target $argv[3]
|
||||
else if test (count $argv) -ge 2 && test "$argv[2]" = --
|
||||
# User used "--" without target
|
||||
echo "No target found."
|
||||
echo "No target found." 1>&2
|
||||
return 1
|
||||
end
|
||||
|
||||
# Make
|
||||
cd $argv[1]
|
||||
cd $directory
|
||||
make $target
|
||||
cd -
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue