Skip to content

Commit

Permalink
Added linting, minor code tweaks, removed getCommand()
Browse files Browse the repository at this point in the history
  • Loading branch information
lonekorean committed Jan 19, 2020
1 parent ef7c636 commit 4c49e93
Show file tree
Hide file tree
Showing 9 changed files with 781 additions and 50 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ Either way you run it, the script will start the wizard. Answer the questions an

## Command Line

The wizard makes it easy to configure your options, but you can also do so via the command line if you want.

For example, the following will give you [Jekyll](https://jekyllrb.com/)-style output in terms of folder structure and filenames.
The wizard makes it easy to configure your options, but you can also do so via the command line if you want. For example, the following will give you [Jekyll](https://jekyllrb.com/)-style output in terms of folder structure and filenames.

Using `npx`:

Expand All @@ -54,7 +52,7 @@ The wizard will still ask you about any options not specifed on the command line
- Type: `boolean`
- Default: `true`

Enable to have the script prompt you for each option. Disable to skip the wizard entirely and use default values for any options not specified via the command line.
Enable to have the script prompt you for each option. Disable to skip the wizard and use default values for any options not specified via the command line.

### Path to WordPress export file?

Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/usr/bin/env node

const path = require('path');
const process = require('process');

const wizard = require('./src/wizard');
const parser = require('./src/parser');
const writer = require('./src/writer');

(async () => {
// parse any command line arguments and run wizard
let config = await wizard.getConfig();
const config = await wizard.getConfig(process.argv);

// parse data from XML and do Markdown translations
let posts = await parser.parseFilePromise(config)
const posts = await parser.parseFilePromise(config)

// write files, downloading images as needed
await writer.writeFilesPromise(posts, config);
Expand Down
Loading

0 comments on commit 4c49e93

Please sign in to comment.