projects
/
xremote.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OCD cosmetics.
[xremote.git]
/
xremote.sh
diff --git
a/xremote.sh
b/xremote.sh
index
9752a9a
..
5536d01
100755
(executable)
--- a/
xremote.sh
+++ b/
xremote.sh
@@
-56,6
+56,10
@@
xremote.sh [-h <remote_host>] [-i <remote_dir>] <script> [script arguments]
@XREMOTE_GET: *.dat
@XREMOTE_PRE: ln -s /home/fleuret/data/pytorch ./data
@XREMOTE_GET: *.dat
@XREMOTE_PRE: ln -s /home/fleuret/data/pytorch ./data
+ If a file with the same name as the script with the .xremote
+ extension appended to it exists, arguments will be read from it by
+ default.
+
If the -h option is provided @XREMOTE_HOST is ignored.
If the -i option is provided, all the files are installed and
If the -h option is provided @XREMOTE_HOST is ignored.
If the -i option is provided, all the files are installed and
@@
-107,11
+111,19
@@
done
######################################################################
######################################################################
-[[ -a "$1" ]] || (help && exit 1)
+[[ -a "$1" ]] || (help && echo >&2 "Cannot find $1" && exit 1)
+
+cd "$(dirname "$1")"
main="$(basename "$1")"
main="$(basename "$1")"
+main_config="${main}.xremote"
-cd "$(dirname "$1")"
+if [[ -f "${main_config}" ]]
+then
+ echo "xremote: found ${main_config}"
+else
+ main_config="${main}"
+fi
shift
shift
@@
-166,7
+178,7
@@
do
esac
fi
esac
fi
-done < "${main}"
+done < "${main
_config
}"
######################################################################
######################################################################
@@
-192,6
+204,7
@@
fi
######################################################################
# I find this slightly ugly ...
######################################################################
# I find this slightly ugly ...
+
for s in "$@"
do
quoted_args="${quoted_args} \"${s}\""
for s in "$@"
do
quoted_args="${quoted_args} \"${s}\""
@@
-226,7
+239,8
@@
do
;;
esac
fi
;;
esac
fi
-done < "${main}"
+
+done < "${main_config}"
set +f
set +f