From 57628a50dba996dd53f8e3a797cd79b0609a51e3 Mon Sep 17 00:00:00 2001 From: Jeffrey Morlan Date: Thu, 12 Nov 2015 15:47:23 -0800 Subject: [PATCH] Upgrade script --- ts/upgrade.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 ts/upgrade.sh diff --git a/ts/upgrade.sh b/ts/upgrade.sh new file mode 100755 index 0000000..0a801f8 --- /dev/null +++ b/ts/upgrade.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ $# != 2 ] +then + echo Upgrade to a new version of TypeScript and apply local changes. + echo Usage: $0 old_version new_version + exit +fi +OLDSRC=~/TypeScript-$1/src +NEWSRC=~/TypeScript-$2/src +for dir in "$OLDSRC" "$NEWSRC" +do + if [ ! -d "$dir" ] + then + echo "$dir" is not a directory + exit + fi +done + +diff -ru "$OLDSRC" . > diffs.tmp +find compiler services -type f -exec cp "$NEWSRC/{}" {} \; +patch --no-backup-if-mismatch -p1 -i diffs.tmp +rm diffs.tmp