Last active
July 2, 2022 17:20
-
-
Save samuraijane/4401c5367e55e4214a178ecde11d3c52 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 | |
DOC_TITLE=$2 | |
if (( $# < 2)); then | |
echo "- - - - -\nERROR: One or more missing arguments\nExecute this command as \"xxf <parentDirectoryName> <titleForHTMLDoc>\"\n- - - - -" | |
1>&2 | |
exit 1 # if in ~/.bashrc, use return here instead of exit | |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment