2015-04-02 20:32:22 +00:00
|
|
|
#!/bin/bash
|
2016-12-31 08:20:45 +00:00
|
|
|
# strip_sourcemap.sh -- strip sourcemaps from a JS file (missing from uglifyjs)
|
|
|
|
# Copyright (C) 2014-present SheetJS
|
2017-09-22 22:18:51 +00:00
|
|
|
# note: this version also renames write_shift / read_shift to _W / _R
|
2015-04-02 20:32:22 +00:00
|
|
|
|
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
if [ -e "$1" ]; then
|
2017-03-13 06:46:37 +00:00
|
|
|
sed -i.sheetjs '/sourceMappingURL/d' "$1"
|
2017-09-22 22:18:51 +00:00
|
|
|
sed -i.sheetjs 's/write_shift/_W/g; s/read_shift/_R/g' "$1"
|
2015-04-02 20:32:22 +00:00
|
|
|
fi
|
|
|
|
else
|
2017-09-22 22:18:51 +00:00
|
|
|
cat - | sed '/sourceMappingURL/d' | sed 's/write_shift/_W/g; s/read_shift/_R/g'
|
2015-04-02 20:32:22 +00:00
|
|
|
fi
|