You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
538 B
28 lines
538 B
2 years ago
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
# updates any Foo*-ti.ts files $root that are older than Foo.ts
|
||
|
|
||
|
root=$1
|
||
|
if [[ -z "$root" ]]; then
|
||
|
echo "Usage: $0 app"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
for root in "$@"; do
|
||
|
for ti in $(find $root/ -iname "*-ti.ts"); do
|
||
|
root=$(basename $ti -ti.ts)
|
||
|
dir=$(dirname $ti)
|
||
|
src="$dir/$root.ts"
|
||
|
if [ ! -e $src ]; then
|
||
|
echo "Cannot find src $src for $ti, aborting"
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ $src -nt $ti ]; then
|
||
|
echo "Updating $ti from $src"
|
||
|
node_modules/.bin/ts-interface-builder $src
|
||
|
fi
|
||
|
done
|
||
|
done
|