Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
skimklin committed Nov 30, 2023
1 parent 93cb45a commit bdc3799
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ command line interface code opener

```bash
$ npm i -g code-opener-cli
or
$ yarn global add code-opener-cli
or
$ pnpm add -g code-opener-cli
```

#### usage
```bash
# first set your workspaces
$ openc workspace add <pathToYourWorkspace>
# open it
$ openc
```

#### tips
```bash
# If your editor is not vscode, then you need to change the cmd command.Idea for example.$folder is a placeholder for the real path
$ openc openCMD "idea $folder"
```

#### config
Expand All @@ -18,7 +36,7 @@ $ openc <folderName>
$ openc config

# set open command, default is "code $folder", example for idea
$ openc "idea $folder"
$ openc openCMD "idea $folder"

# set folder alias
$ openc alias <alias> <originFolderName>
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "code-opener-cli",
"version": "0.0.2",
"version": "0.0.3",
"description": "command line interface code opener",
"keywords": [
"cli"
],
"main": "src/index.ts",
"bin": {
"openc": "bin/index.js"
Expand Down
7 changes: 1 addition & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { SETTING_COMMANDS, changeConfig, readConfig, writeConfig } from './configFile';
import { Log, formatObjectJson } from './utils';
import { executeOpenCMD, searchFolder } from './folderSearch';
import path from 'path';
import { searchFolder } from './folderSearch';

const argv = <{ _: string[] }> yargs(hideBin(process.argv)).argv;

Expand All @@ -14,10 +13,6 @@ if (!command) {
process.exit(1);
}

Log.info(
formatObjectJson(path.parse(process.cwd()))
)

;(async () => {
const config = await readConfig();
Log.debug('config:', formatObjectJson(config));
Expand Down

0 comments on commit bdc3799

Please sign in to comment.