Created
July 2, 2022 15:58
-
-
Save samuraijane/8a54e8aa13e7864f337d313d392c4b34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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