Skip to content

Instantly share code, notes, and snippets.

@m3g4p0p
Created October 12, 2018 20:27
Show Gist options
  • Save m3g4p0p/1b012b3980a6efe0073d26764b8afe73 to your computer and use it in GitHub Desktop.
Save m3g4p0p/1b012b3980a6efe0073d26764b8afe73 to your computer and use it in GitHub Desktop.
Initialize a project with standard installed
#!/bin/sh
name=$1
if [[ $2 ]]
then
cd $1
name=$2
fi
mkdir $name
cd $name
touch $name.js
touch $name.css
cat <<EOT >> index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>$1</title>
<link rel="stylesheet" href="./$name.css">
</head>
<body>
<script src="./$name.js"></script>
</body>
</html>
EOT
cat <<EOT >> package.json
{
"standard": {
"env": {
"browser": true
}
}
}
EOT
yarn add standard -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment