Skip to content

Commit

Permalink
Updated package and main module
Browse files Browse the repository at this point in the history
  • Loading branch information
ts5746 committed Oct 27, 2019
1 parent 5d308ba commit 02be38e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ environment.
To deploy the Whiteflag WHL utility, make sure the following prerequisite
software is installed:

* Node.js w/ NPM
* [Node.js](https://nodejs.org/en/about/) including [NPM](https://www.npmjs.com/get-npm)

### Deployment

Expand Down Expand Up @@ -58,7 +58,7 @@ wfwhl [-s <id> ...] [-w <url>|-f <file>]
The main options are the following:

* `-s`, `--sites` : Specify the world heritage site(s) to be processed by \<id\> number; multiple sites may be specified. If no sites are specified, all sites are processed.
* `-w`, `--web` : The source \<url\> of the WHL in XML on the web. If not specified the default is `https://whc.unesco.org/en/list/xml/`. Cannot be used with `-f`.
* `-w`, `--web` : The source \<url\> of the WHL in XML on the web. If not specified the default is `https://whc.unesco.org/en/list/xml/`. Cannot be used with `-f`.
* `-f`, `--file` : The source \<file\> containing the WHL in XML. Cannot be used with `-w`.
* `-t`, `--transmit`** : Transmit the Whiteflag message(s) on the blockchain. Requires `-i`, `-b` and `-a` to be specified.
* `-i`, `--interface`** : The Whiteflag API REST interface \<url\> to post the message(s) to be sent.
Expand Down
11 changes: 6 additions & 5 deletions index.js → main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const whiteflag = require('./lib/whiteflag');

/*
* Gracefully crash if an uncaught exception occurs and
* ensure proper shutdonwn when process is stopped
* ensure proper shutdown when process is stopped
*/
process.on('uncaughtException', uncaughtExceptionCb);
process.on('SIGINT', interruptCb);
process.on('SIGTERM', interruptCb);

// MAIN //
// EXECUTE MAIN PROCESS FUNCTION //
main(function mainCb(err, exitcode = 0) {
if (err) errorHandler(err, exitcode);
process.exit(exitcode);
if (err) return errorHandler(err, exitcode);
return process.exit(exitcode);
});

// PRIVATE FUNCTIONS //
// MAIN FUNCTIONS //
/**
* Main process function
* @function main
Expand All @@ -49,6 +49,7 @@ function main(callback) {
});
}

// CALLBACK AND HANDLER FUNCTIONS //
/**
* Function to handle errors
* @function errorHandler
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
"test": "./test",
"doc": "./doc"
},
"main": "index.js",
"main": "main.js",
"bin": {
"wfwhl": "./index.js"
"whiteflag-whl": "./main.js",
"wfwhl": "./main.js"
},
"scripts": {
"start": "node whiteflag.js",
"start": "node main.js",
"test": "mocha --recursive",
"doc:src": "jsdoc -c .jsdoc.json",
"count": "cloc --exclude-dir=node_modules,.vscode --exclude-list-file=.clocignore --by-file lib",
Expand Down

0 comments on commit 02be38e

Please sign in to comment.