Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ run(async () => {
// @type { quotes: Quote[], authors: Author[], tags: Tag[] }
const db = parseDataFiles(DEST)

Object.keys(src).forEach(key => {
if (typeof db.key === 'undefined') {
db[key] = []
}
})

// Apply transforms to the source data to create the generated data files
// This will add computed properties that are not included in the source
// data files.
Expand Down
2 changes: 1 addition & 1 deletion cli/sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Before running this command, make sure you run the build command to create / upd
## Usage

```sh
$ node cli/syncData [<dataDir>] [..options]
$ node cli/sync [<dataDir>] [..options]
```

## Options
Expand Down
3 changes: 2 additions & 1 deletion cli/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ try {
await testConnection()
log.newLine()

const dataFiles = parseDataFiles(dataDir.generated)
const dataSrc = args.d || args.dest || dataDir.generated
const dataFiles = parseDataFiles(dataSrc)

// Connect to the database
await client.connect()
Expand Down