Skip to content

Instantly share code, notes, and snippets.

@devopsmariocom
Created October 7, 2015 12:22
Show Gist options
  • Save devopsmariocom/b289eb69e00696fbb21e to your computer and use it in GitHub Desktop.
Save devopsmariocom/b289eb69e00696fbb21e to your computer and use it in GitHub Desktop.
Pass entry file as argument to add imports of all other files
#!/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