Last active
March 25, 2017 19:35
-
-
Save mmahadevan-okta/e2d19ae3668b8c571a419772eb7f97ec to your computer and use it in GitHub Desktop.
Setup Typescript with VS Code.
This file contains 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
#!/usr/bin/env sh | |
if [ "$1" != "" ]; then | |
mkdir "$1" && cd "$1" | |
if [ "$(type -t curl)" == "file" ]; then | |
curl -L -s https://www.gitignore.io/api/node,macos >> .gitignore | |
else | |
echo "curl not found." | |
fi | |
cat << EOT >> tsconfig.json | |
{ | |
"compilerOptions": { | |
"target": "es5", | |
"outDir": "out/", | |
"sourceMap": true | |
} | |
} | |
EOT | |
mkdir src && cd src | |
cat <<EOT >> app.ts | |
class Startup { | |
public static main(): number { | |
console.log('Hello World'); | |
return 0; | |
} | |
} | |
Startup.main(); | |
EOT | |
echo "code .\n Press Cmd-Shift-B\nChoose Typescript with Watch-mode" | |
else | |
echo "$0 directory_name" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment