Created
September 14, 2016 11:25
-
-
Save deepak/33966e98a76f30d6db9e617bdab4685c to your computer and use it in GitHub Desktop.
elm-new.sh
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
function elm-new() { | |
mkdir -p $1 | |
cd $1 | |
# from https://github.com/github/gitignore/blob/master/Elm.gitignore | |
echo "# elm-package generated files | |
elm-stuff | |
# elm-repl generated files | |
repl-temp-*" > .gitignore | |
mkdir src | |
touch src/.gitkeep | |
# we get something like this from | |
# elm-package install elm-lang/core --yes | |
echo '{ | |
"version": "0.0.1", | |
"summary": "TODO: helpful summary of your project, less than 80 characters", | |
"repository": "https://github.com/deepak/trying-elm.git", | |
"license": "BSD3", | |
"source-directories": [ | |
"src" | |
], | |
"exposed-modules": [], | |
"dependencies": { | |
"elm-lang/core": "4.0.1 <= v < 5.0.0", | |
"elm-lang/html": "1.1.0 <= v < 2.0.0" | |
}, | |
"elm-version": "0.17.0 <= v < 0.18.0" | |
}' > elm-package.json | |
elm-package install --yes | |
echo '<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- These meta tags come first. --> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>TODO: add title</title> | |
<script type="text/javascript" src="/build/elm.js"></script> | |
</head> | |
<body></body> | |
<script type="text/javascript"> | |
var app = Elm.Main.fullscreen(); | |
</script> | |
</html>' > index.html | |
git init | |
git add . | |
git commit -m "initial commit" | |
touch src/Main.elm | |
echo "have a couple of TODOs" | |
ag todo . | |
elm-live src/Main.elm --open --pushstate --output=build/elm.js | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment