Loading .shell/lib/shared.sh +18 −0 Original line number Diff line number Diff line Loading @@ -116,3 +116,21 @@ if has realpath; then elif has readlink; then expand() { readlink -f "$1"; } fi if has date; then get_utime() { if [ -n "$1" ]; then date -r "$1" '+%s' else date '+%s' fi } elif has cscript; then get_utime() { if [ -n "$1" ]; then cscript //nologo ~/.shell/lib/utime.js /from:"$1" else cscript //nologo ~/.shell/lib/utime.js fi } fi .shell/lib/shell-funcs.sh +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ check_submodule() do_update() { local timestamp=${HOME}/.shell/.update local now=`date +%s` updated=`date -r "$timestamp" +%s 2>/dev/null` local now=`get_utime` updated=`get_utime "$timestamp"` local BOLD_BLUE=$'\033[34;1m' DEFAULT=$'\033[m' local prompt="${BOLD_BLUE}Would you like to update dotfiles?${DEFAULT} " local shell=`get_shell` Loading .shell/lib/utime.js 0 → 100644 +10 −0 Original line number Diff line number Diff line FileSystemObject = new ActiveXObject("Scripting.FileSystemObject"); Opts = WScript.Arguments.Named; if ( Opts.Exists("from") ) { date = new Date(FileSystemObject.GetFile(Opts.Item("from")).DateLastModified); } else { date = new Date(); } WScript.Echo(date.getTime()); Loading
.shell/lib/shared.sh +18 −0 Original line number Diff line number Diff line Loading @@ -116,3 +116,21 @@ if has realpath; then elif has readlink; then expand() { readlink -f "$1"; } fi if has date; then get_utime() { if [ -n "$1" ]; then date -r "$1" '+%s' else date '+%s' fi } elif has cscript; then get_utime() { if [ -n "$1" ]; then cscript //nologo ~/.shell/lib/utime.js /from:"$1" else cscript //nologo ~/.shell/lib/utime.js fi } fi
.shell/lib/shell-funcs.sh +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ check_submodule() do_update() { local timestamp=${HOME}/.shell/.update local now=`date +%s` updated=`date -r "$timestamp" +%s 2>/dev/null` local now=`get_utime` updated=`get_utime "$timestamp"` local BOLD_BLUE=$'\033[34;1m' DEFAULT=$'\033[m' local prompt="${BOLD_BLUE}Would you like to update dotfiles?${DEFAULT} " local shell=`get_shell` Loading
.shell/lib/utime.js 0 → 100644 +10 −0 Original line number Diff line number Diff line FileSystemObject = new ActiveXObject("Scripting.FileSystemObject"); Opts = WScript.Arguments.Named; if ( Opts.Exists("from") ) { date = new Date(FileSystemObject.GetFile(Opts.Item("from")).DateLastModified); } else { date = new Date(); } WScript.Echo(date.getTime());