placeholders of format generation scripts

This commit is contained in:
Doug Bird 2017-12-04 15:33:08 -08:00
parent 24b5e6507f
commit e803a7fa12
4 changed files with 120 additions and 2 deletions

View File

@ -1,3 +1,96 @@
#!/bin/bash
echo "NOT COMPLETED..."
echo "This is a placeholder for a script that will read the 'tlds.csv' file and generate the various enumerations in the target languages (js, php, etc.)"
################################################################################
## "generate-all.sh"
## (Re)generates all TLD Enumeration format files using the current
## contents of the 'tlds.csv' file.
################################################################################
################################################################################
## this script does not have any configuration variables
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
## convenience variable for referring to this script
################################################################################
ME_NAME='generate-all.sh'
################################################################################
##
## introduction
##
################################################################################
echo "$ME_NAME"
echo -e " (re)generates all TLD format files using the current contents of the 'tlds.csv' file\n"
################################################################################
##
## generate PHP format
##
################################################################################
echo "generating PHP format..."
generate-php-tld-enum.php
GEN_STATUS=$?
################################################################################
##
## enforce that PHP format generation was a reported success before proceeding
##
################################################################################
if [ "$GEN_STATUS" -ne "0" ]; then
>&2 echo -e "$ME_NAME: cannot continue; PHP generator script failed (exit status $GEN_STATUS)"
exit $GEN_STATUS
fi
################################################################################
##
## generate JSON format
##
################################################################################
echo "generating JSON format..."
generate-json-tld-enum.js
GEN_STATUS=$?
################################################################################
##
## enforce that JSON format generation was a reported success before proceeding
##
################################################################################
if [ "$GEN_STATUS" -ne "0" ]; then
>&2 echo -e "$ME_NAME: cannot continue; JSON generator script failed (exit status $GEN_STATUS)"
exit $GEN_STATUS
fi
################################################################################
##
## generate CSV (text) format
##
################################################################################
echo "generating CSV (text) format..."
generate-csv-tld-enum.js
GEN_STATUS=$?
################################################################################
##
## enforce that CSV format generation was a reported success before proceeding
##
################################################################################
if [ "$GEN_STATUS" -ne "0" ]; then
>&2 echo -e "$ME_NAME: cannot continue; CSV (text) generator script failed (exit status $GEN_STATUS)"
exit $GEN_STATUS
fi
################################################################################
##
## indicate success with message
##
################################################################################
echo "successfully (re)generated all TLS format files"

View File

@ -0,0 +1,4 @@
#!/usr/bin/env node
console.log("generates the 'tlds-name-only.csv' CSV text file from the 'tlds.csv' csv file");
console.log("---this script is currently a 'to-do' placeholder!---");
console.error("terminating... the development for the 'CSV' (text) format generator has not yet been completed");

View File

@ -0,0 +1,4 @@
#!/usr/bin/env node
console.log("generates the 'tld-list.json' JSON array file from the 'tlds.csv' csv file");
console.log("---this script is currently a 'to-do' placeholder!---");
console.error("terminating... the development for the 'JSON' format generator has not yet been completed");

View File

@ -0,0 +1,17 @@
#!/usr/bin/env php
<?php
(function() {
echo "generates the 'TldEnum.php' class definition file from the 'tlds.csv' csv file";
echo "---this script is currently a 'to-do' placeholder!---";
$exit_message = "terminating... the development for the 'PHP' format generator has not yet been completed";
if (\PHP_SAPI=='cli') {
fwrite(\STDERR,$exit_message);
} else {
echo $exit_message ;
}
exit(1);
})();