-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Rename the `downloader` module to `actions/download` with the intent of placing future implementations of CLI actions under the `actions` top levle module. 2. Use `commander` to define basic command line interface: * Default _no-name_ command to download all new files from a specified removable drive. * `init` command to initialize a global configuration for this tool.
- Loading branch information
Showing
15 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Note: consilder all sub-modules to be 'private' to this module and do not re-export any of them here. | ||
import { Downloader } from "./downloader"; | ||
|
||
export async function downloadAllNewFiles(drivePath: string) { | ||
await new Downloader().downloadAllNewFiles(drivePath); | ||
} |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
console.log("Hello world!"); | ||
import { program } from "commander"; | ||
import { downloadAllNewFiles } from "./actions/download"; | ||
|
||
program | ||
.command("init") | ||
.description("Initialize a global configuration") | ||
.action(async () => { | ||
// TODO: initialize configuration. | ||
throw new Error("Not implemented yet"); | ||
}); | ||
|
||
program | ||
.description( | ||
`Download all new files from the specified removable drive (e.g. a memory card). | ||
Relies on the global configuration to identify supported directories on the removable drive and to determine where their contents should be saved.` | ||
) | ||
// This removes `[command]` from the default no-name command usage sample to avoid the implication | ||
// that explicit commands (i.e. other than the default no-name command) require the `drive-path` argument. | ||
.usage("<drive-path>") | ||
.argument("<drive-path>", "Removable drive (e.g. memory card) path") | ||
.action(downloadAllNewFiles); | ||
|
||
program.parse(); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
test/downloader/downloader.spec.ts → test/actions/download/downloader.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/downloader/file-copier.spec.ts → test/actions/download/file-copier.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/downloader/placement-strategy.spec.ts → ...tions/download/placement-strategy.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters