Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
💣 Rename CLI commands from aerofly- to aewx-
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Jan 15, 2019
1 parent a866d43 commit bd15473
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
mocha: true
es6: true
parserOptions:
ecmaVersion: 6
ecmaVersion: 2017
rules:
arrow-parens:
- error
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change log

For detailed information check [Aerofly Weather's releases on Github](https://github.com/fboes/aerofly-weather/releases).

* :bomb: Rename CLI commands from `aerofly-` to `aewx-`
* :pill: METAR parser now reads `KPH`
* :pill: Fix conversion for m/s to knots
* :pill: Get ICAO code from Aerofly FS 2 flightplan destination
Expand All @@ -25,13 +26,13 @@ For detailed information check [Aerofly Weather's releases on Github](https://gi
0.3.0
-----

* :bomb: Changed internal METAR object structure to match https://api.checkwx.com/#31-single
* :gift: Add CLI parameters `--time=<X>` and `--date=<X>`
* :gift: Add General Data Protection Regulation (GDPR) compliance statement
* :gift: Add examples for desktop integration
* :gift: Add `aerofly-make-batch` to add desktop shortcut for `aerofly-metar`
* :pill: Maximum possible values match Aerofly FS 2 settings
* :wrench: Improve internal documentation and structure
* :bomb: Changed internal METAR object structure to match https://api.checkwx.com/#31-single

0.2.0
-----
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Installation
1. This tool requires Windows, Mac OSX or Linux.
1. Make sure you have [Node.js](https://nodejs.org/) with at least version 10 installed. Call `node -v` to see your current version.
1. Run `npm install -g aerofly-weather` to install Aerofly-Weather.
1. Use `aerofly-make-batch` to create a batch file on your desktop.
1. Use `aewx-make-batch` to create a batch file on your desktop.

This package also comes with a load of [command line tools](docs/command-line.md). For basic usage the desktop batch file will suffice.

Expand All @@ -29,7 +29,7 @@ Usage of desktop batch file

You will need a copy of IPACS' Aerofly FS 2 which has run at least once. This creates a file called `main.mcf`, which contains all settings and the weather data in Aerofly FS 2. This file will be modified by the tools supplied with this package.

Click on the desktop file called `aerofly-weather.bat` / `aerofly-weather.sh` and follow the on-screen instructions. Basically it offers you to:
Click on the desktop file called `aewx-weather.bat` / `aewx-weather.sh` and follow the on-screen instructions. Basically it offers you to:

* Set weather data from a [METAR weather string](docs/metar.md).
* Fetch a METAR weather string from an URL and set the weather accordingly.
Expand All @@ -47,7 +47,7 @@ Update

1. To find out if your installation of Aerofly-Weather needs updating, run `npm outdated -g aerofly-weather`.
2. Run `npm update -g aerofly-weather` to update your local Aerofly-Weather installation to the latest stable release.
3. Optional: Use `aerofly-make-batch` to create a new batch file on your desktop.
3. Optional: Use `aewx-make-batch` to create a new batch file on your desktop.

Status
-------
Expand Down
2 changes: 1 addition & 1 deletion bin/aerofly-checkwx → bin/aewx-checkwx
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (args._.length === 1 && process.env.CHECKWX_APIKEY) {
args._.push(process.env.CHECKWX_APIKEY);
}
if (args._.length < 2 || args.help) {
console.log(`Usage: aerofly-checkwx <ICAO> [CHECKWX_APIKEY] [FILE]
console.log(`Usage: aewx-checkwx <ICAO> [CHECKWX_APIKEY] [FILE]
Copy METAR information from https://api.checkwx.com into your Aerofly FS2
configuration file. You will need an API key to fetch information.
Expand Down
8 changes: 4 additions & 4 deletions bin/aerofly-make-batch → bin/aewx-make-batch
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use strict';

if (process.argv.length > 2 && process.argv[2] === '--help') {
console.log(`Usage: aerofly-make-batch [TYPE]
console.log(`Usage: aewx-make-batch [TYPE]
Create a new batch file on your desktop for quickly starting METAR import to
Aerofly FS 2.
Expand All @@ -20,19 +20,19 @@ const fs = require('fs');
const path = require('path');

const homedir = os.homedir();
const sourceFile = process.argv[2] ? path.basename('aerofly-' + process.argv[2]) : 'aerofly-weather';
const sourceFile = process.argv[2] ? path.basename('aewx-' + process.argv[2]) : 'aewx-weather';

if (homedir) {
let leSource = '';
let leTarget = '';
if (os.platform().match(/^win/)) {
// Microsoft Windows
leSource = path.join(__dirname, '..', 'docs', sourceFile + '.bat');
leTarget = path.join(homedir, 'Desktop', 'aerofly-weather.bat');
leTarget = path.join(homedir, 'Desktop', 'aewx-weather.bat');
} else {
// Linux / Mac OSX
leSource = path.join(__dirname, '..', 'docs', sourceFile + '.sh');
leTarget = path.join(homedir, 'Desktop', 'aerofly-weather.sh');
leTarget = path.join(homedir, 'Desktop', 'aewx-weather.sh');
}

if (leTarget && leSource) {
Expand Down
2 changes: 1 addition & 1 deletion bin/aerofly-metar → bin/aewx-metar
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const args = require('../lib/argumentor')(process.argv);

if (args._.length < 1 || args.help) {
console.log(`Usage: aerofly-metar "<METAR>" [FILE]
console.log(`Usage: aewx-metar "<METAR>" [FILE]
Copy METAR information string into your Aerofly FS2 configuration file.
For more information on METAR see https://aviationweather.gov/metar.
Expand Down
2 changes: 1 addition & 1 deletion bin/aerofly-metar-url → bin/aewx-metar-url
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const args = require('../lib/argumentor')(process.argv);

if (args._.length < 1 || args.help) {
console.log(`Usage: aerofly-fetch <URL> [FILE]
console.log(`Usage: aewx-fetch <URL> [FILE]
Copy raw METAR information from URL into your Aerofly FS2 configuration file.
Expand Down
2 changes: 1 addition & 1 deletion docs/aerofly-checkwx.bat → docs/aewx-checkwx.bat
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY main.mcf main.bak
: Replace 12345abcd with actual API key
SET CHECKWX_APIKEY=12345abcd
SET /p ICAO=Enter ICAO code:
CALL aerofly-checkwx %ICAO% %CHECKWX_APIKEY% --verbose
CALL aewx-checkwx %ICAO% %CHECKWX_APIKEY% --verbose

PAUSE
START steam://rungameid/434030
2 changes: 1 addition & 1 deletion docs/aerofly-checkwx.sh → docs/aewx-checkwx.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ cp main.mcf main.bak
# Replace 12345abcd with actual API key
CHECKWX_APIKEY=12345abcd
read -p 'Enter ICAO string: ' ICAO
aerofly-checkwx ${ICAO} ${CHECKWX_APIKEY} --verbose
aewx-checkwx ${ICAO} ${CHECKWX_APIKEY} --verbose
2 changes: 1 addition & 1 deletion docs/aerofly-metar.bat → docs/aewx-metar.bat
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CD "%userprofile%\Documents\Aerofly FS 2"
COPY main.mcf main.bak

SET /p METAR=Enter METAR:
CALL aerofly-metar %METAR% --verbose
CALL aewx-metar %METAR% --verbose

PAUSE
START steam://rungameid/434030
2 changes: 1 addition & 1 deletion docs/aerofly-metar.sh → docs/aewx-metar.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cd ~/Documents/Aerofly FS 2 # Replace with actual save data directory
cp main.mcf main.bak

read -p 'Enter METAR string: ' METAR
aerofly-metar ${METAR} --verbose
aewx-metar ${METAR} --verbose
6 changes: 3 additions & 3 deletions docs/aerofly-weather.bat → docs/aewx-weather.bat
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY /Y main.mcf main.bak

:Metar
SET /p METAR=Enter METAR string ?
CALL aerofly-metar "%METAR%" --verbose
CALL aewx-metar "%METAR%" --verbose
ECHO -------------------------------------------------------
GOTO Menu

Expand All @@ -46,7 +46,7 @@ COPY /Y main.mcf main.bak
GOTO Menu
)
SET /p ICAO=Enter ICAO code ?
CALL aerofly-metar-url %METAR_URL%%ICAO%%METAR_URL_END% --verbose
CALL aewx-metar-url %METAR_URL%%ICAO%%METAR_URL_END% --verbose
ECHO -------------------------------------------------------
GOTO Menu

Expand All @@ -64,7 +64,7 @@ COPY /Y main.mcf main.bak
GOTO Menu
)
SET /p ICAO=Enter ICAO code ?
CALL aerofly-checkwx %ICAO% %CHECKWX_APIKEY% --verbose
CALL aewx-checkwx %ICAO% %CHECKWX_APIKEY% --verbose
ECHO -------------------------------------------------------
GOTO Menu

Expand Down
6 changes: 3 additions & 3 deletions docs/aerofly-weather.sh → docs/aewx-weather.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ do
case $OPT in
"METAR input")
read -p 'Enter METAR string: ' METAR
aerofly-metar "${METAR}" --verbose
aewx-metar "${METAR}" --verbose
;;

"METAR URL")
Expand All @@ -31,7 +31,7 @@ do
exit 1
fi
read -p 'Enter ICAO string: ' ICAO
aerofly-metar-url ${METAR_URL}${ICAO}${METAR_URL_END} --verbose
aewx-metar-url ${METAR_URL}${ICAO}${METAR_URL_END} --verbose
;;

"Check URL")
Expand All @@ -48,7 +48,7 @@ do
exit 1
fi
read -p 'Enter ICAO string: ' ICAO
aerofly-checkwx ${ICAO} ${CHECKWX_APIKEY} --verbose
aewx-checkwx ${ICAO} ${CHECKWX_APIKEY} --verbose
;;

"Start Aerofly FS 2")
Expand Down
27 changes: 14 additions & 13 deletions docs/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ Usage of Command Line Tools

The command line tools allow for a number of ways to get METAR information into IPACS' Aerofly FS 2, depending on your [source of METAR information](./metar.md):

* `aerofly-metar <METAR>`:
* `aewx-metar <METAR>`:
Insert the [METAR information](./metar.md) into your configuration file, with `<METAR>` being a valid METAR forecast string enclosed in quotes.
* `aerofly-metar-url <URL>`:
* `aewx-metar-url <URL>`:
Fetch [METAR information](./metar.md) from an `<URL>`. The URL method may be used with a METAR API which supplies _raw_ METAR information.
* `aerofly-checkwx <ICAO-CODE> [API-KEY]`:
* `aewx-checkwx <ICAO-CODE> [API-KEY]`:
Fetch [METAR information](./metar.md) supplied by https://api.checkwx.com/. You will need a valid `[API-KEY]` from https://api.checkwx.com/, and supply the `<ICAO-CODE>` from your selected airport.

These parameters will work with `aerofly-metar`, `aerofly-metar-url` and `aerofly-checkwx`:
These parameters will work with `aewx-metar`, `aewx-metar-url` and `aewx-checkwx`:

* `[FILE]`: Every command accepts a last parameter to specify the file location. By default this will be `main.mcf` in the current directory. You may want to supply `"%userprofile%\Documents\Aerofly FS 2\main.mcf"` (Microsoft Windows) to change your `main.mcf` regardless of your current directory.
* `--hours=<ZZ>`: Change time copied from METAR information to Aerofly FS 2 by `ZZ` hours. Add `-` for negative values.
* `--time=<HH:MM+ZZ:ZZ>`: Set time to HH:MM+ZZ:ZZ in Aerofly FS 2, e.g. `12:30-08:00`. Remember to include the time zone, else the time will be interpreted as UTC time.
* `--date=<YYYY-MM-DD>`: Set date to YYYY-MM-DD in Aerofly FS 2, e.g. `2018-12-31`.
* `--flightplan`: Delete currently active flightplan if origin or destination does not match METAR ICAO code.
* `--verbose`: Output extra information about found and parsed data.
* `--help`: Show help information about tool.

Expand All @@ -26,20 +27,20 @@ Examples for command line tool integrations

### Microsoft Windows

* [`aerofly-weather.bat`](aerofly-weather.bat): Interactive menu, will be used for desktop batch file.
* [`aerofly-metar.bat`](aerofly-metar.bat): Ask user every time for METAR string.
* [`aerofly-checkwx.bat`](aerofly-checkwx.bat): Ask user every time for ICAO code to fetch METAR information from CheckWX.
* [`aewx-weather.bat`](aewx-weather.bat): Interactive menu, will be used for desktop batch file.
* [`aewx-metar.bat`](aewx-metar.bat): Ask user every time for METAR string.
* [`aewx-checkwx.bat`](aewx-checkwx.bat): Ask user every time for ICAO code to fetch METAR information from CheckWX.

### Linux / Mac OS X

* [`aerofly-weather.sh`](aerofly-weather.sh): Interactive menu, will be used for desktop batch file.
* [`aerofly-metar.sh`](aerofly-metar.sh): Ask user every time for METAR string.
* [`aerofly-checkwx.sh`](aerofly-checkwx.sh): Ask user every time for ICAO code to fetch METAR information from CheckWX.
* [`aewx-weather.sh`](aewx-weather.sh): Interactive menu, will be used for desktop batch file.
* [`aewx-metar.sh`](aewx-metar.sh): Ask user every time for METAR string.
* [`aewx-checkwx.sh`](aewx-checkwx.sh): Ask user every time for ICAO code to fetch METAR information from CheckWX.

Environment variables
---------------------

`aerofly-checkwx` requires you to enter your API key every time the command is executed. For convenience you may store your API key in a local environment variable called `CHECKWX_APIKEY`. To set the environment variable use the following examples, replacing `12345abcd` with your actual key:
`aewx-checkwx` requires you to enter your API key every time the command is executed. For convenience you may store your API key in a local environment variable called `CHECKWX_APIKEY`. To set the environment variable use the following examples, replacing `12345abcd` with your actual key:

### Microsoft Windows

Expand All @@ -59,10 +60,10 @@ echo "export CHECKWX_APIKEY=$CHECKWX_APIKEY" >> ~/.bash_profile
Add data from `STDIN`
---------------------

For Linux / Mac OS X: All `aerofly-weather` tools do not accept input from `STDIN`. To remedy this shortcoming pipe `STDIN` into a variable:
For Linux / Mac OS X: All `aewx-weather` tools do not accept input from `STDIN`. To remedy this shortcoming pipe `STDIN` into a variable:

```bash
METAR=$(cat METAR.txt)
aerofly-metar $METAR
aewx-metar $METAR

```
4 changes: 2 additions & 2 deletions docs/metar.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ These sites make METAR information publicly available:
* https://aviationweather.gov/metar
* https://metars.com/

Copy METAR strings found on these pages to `aerofly-metar`.
Copy METAR strings found on these pages to `aewx-metar`.

Some METAR examples
-------------------
Expand Down Expand Up @@ -44,6 +44,6 @@ LSGG 050820Z VRB01KT 9999 FEW070 BKN110 M03/M04 Q1033 NOSIG
Use CheckWX API
---------------

If your want to use `aerofly-checkwx` you will need to apply for a CheckWX API key. See https://api.checkwx.com/ on how to get an API key.
If your want to use `aewx-checkwx` you will need to apply for a CheckWX API key. See https://api.checkwx.com/ on how to get an API key.

After receiving your API key, you will need to enter this key into your desktop batch file or your [local command line tools](command-line.md).

0 comments on commit bd15473

Please sign in to comment.