Created
October 7, 2015 12:22
-
-
Save devopsmariocom/b289eb69e00696fbb21e to your computer and use it in GitHub Desktop.
Pass entry file as argument to add imports of all other files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rootFile=$1 | |
entryFile=${rootFile}-entryFile | |
dirName=$(dirname $rootFile) | |
mv $rootFile $entryFile | |
for n in ${dirName}/*.?s; do | |
fileName=$(basename $n) | |
echo "import './${fileName%.*}';" >> $entryFile | |
done | |
mv $entryFile ${rootFile%.js}.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment