Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save samuraijane/8a54e8aa13e7864f337d313d392c4b34 to your computer and use it in GitHub Desktop.
Save samuraijane/8a54e8aa13e7864f337d313d392c4b34 to your computer and use it in GitHub Desktop.
#!/bin/bash
PARENT_DIR=$1
if [[ -z $PARENT_DIR ]]; then
echo "Name of the parent directory"
read PARENT_DIR
fi
CURRENT_DIR=$(pwd)
[[ -d $PARENT_DIR ]] && echo $PARENT_DIR already exists. Process terminated.
DOC_TITLE=$1
if [[ -z $DOC_TITLE ]]; then
echo "Name of the title name for the HTML document"
read DOC_TITLE
fi
mkdir $PARENT_DIR
cd $PARENT_DIR
echo "<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\" />
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />
<title>$DOC_TITLE</title>
<link href=\"./style.css\" rel=\"stylesheet\" />
</head>
<body>
<script src=\"./main.js\" type=\"text/javascript\"></script>
</body>
</html>" >>index.html
touch main.js style.css
echo "Done"
# this script is based on a script written by TravisL12 at https://gist.github.com/TravisL12/233fd442a2b8362d82b89e6dd3a69c19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment