-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d280cd1
commit 37f1d5e
Showing
12 changed files
with
229 additions
and
174 deletions.
There are no files selected for viewing
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,64 @@ | ||
# Usage | ||
|
||
## wikigdrive usage | ||
|
||
|
||
$ wikigdrive <command> [args] [<options>] | ||
|
||
Main commands: | ||
|
||
wikigdrive config | ||
--client_id | ||
--client_secret | ||
--service_account=./private_key.json | ||
|
||
wikigdrive service | ||
|
||
wikigdrive add [folder_id_or_url] | ||
--drive [shared drive url] | ||
--workdir (current working folder) | ||
--link_mode [mdURLs|dirURLs|uglyURLs] | ||
|
||
wikigdrive pull [URL to specific file] | ||
|
||
wikigdrive watch (keep scanning for changes, ie: daemon) | ||
|
||
Other commands: | ||
|
||
wikigdrive status [ID of document] - Show status of the document or stats of the entire path. | ||
wikigdrive drives | ||
wikigdrive sync | ||
wikigdrive download | ||
wikigdrive transform | ||
|
||
Options: | ||
--workdir (current working folder) | ||
|
||
Examples: | ||
$ wikigdrive init | ||
$ wikigdrive add https://google.drive... | ||
|
||
## wikigdrive drives usage | ||
|
||
$ wikigdrive drives [<options>] | ||
|
||
Options: | ||
|
||
--client_id GOOGLE_DRIVE_API CLIENT_ID | ||
--client_secret GOOGLE_DRIVE_API CLIENT_SECRET | ||
--service_account GOOGLE_DRIVE_API SERVICE_ACCOUNT_JSON file location | ||
|
||
Examples: | ||
|
||
wikigdrive drives --client_id=AAA --client_secret=BBB | ||
wikigdrive drives --service_account=./private_key.json | ||
|
||
## All commands | ||
|
||
Other commands: | ||
|
||
wikigdrive status | ||
wikigdrive drives | ||
wikigdrive sync | ||
wikigdrive download | ||
wikigdrive transform |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {EventEmitter} from 'events'; | ||
import {FileContentService} from '../utils/FileContentService'; | ||
import {createLogger} from '../utils/logger/logger'; | ||
import {ContainerEngine} from '../ContainerEngine'; | ||
|
||
export async function initEngine(workdir: string) { | ||
const mainFileService = new FileContentService(workdir); | ||
await mainFileService.mkdir('/'); | ||
|
||
const eventBus = new EventEmitter(); | ||
eventBus.setMaxListeners(0); | ||
eventBus.on('panic:invalid_grant', () => { | ||
process.exit(1); | ||
}); | ||
eventBus.on('panic', (error) => { | ||
throw error; | ||
}); | ||
|
||
const logger = createLogger(workdir, eventBus); | ||
const containerEngine = new ContainerEngine(logger, mainFileService); | ||
return {mainFileService, containerEngine, logger}; | ||
} |
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
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
Oops, something went wrong.