Skip to content

Commit aee20c7

Browse files
v2 release: add pm create command (#37)
v2
2 parents 31b2193 + b340c32 commit aee20c7

23 files changed

+10488
-3516
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
'arrow-parens': 0,
2121
'guard-for-in': 0,
2222
'valid-jsdoc': 0,
23+
'no-undef': 'error',
2324
'operator-linebreak': [
2425
'error',
2526
'after',

.npmignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ mocharc.json
33
build
44
dist
55
_config.yml
6-
images
6+
images
7+
.eslintrc.js
8+
.eslintignore
9+
.prettierignore
10+
.prettierrc
11+
.vscode/

CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Production Releases
22
(Note: Only production releases will be mentioned here, If you want to see beta releases, you can find them [here](https://github.com/saurabhdaware/projectman/releases))
33

4-
### v1.3.3 *[LATEST RELEASE]*
5-
Command suggestions added (Thanks [@jamesgeorge007](https://github.com/jamesgeorge007) for [#PR32](https://github.com/saurabhdaware/projectman/pull/32))
4+
### v2.0.0 *[LATEST RELEASE]*
5+
6+
- Add `pm create` command
7+
- Remove support for binaries
8+
69

10+
### v1.3.3
11+
12+
Command suggestions added (Thanks [@jamesgeorge007](https://github.com/jamesgeorge007) for [#PR32](https://github.com/saurabhdaware/projectman/pull/32))
713

814

915
### v1.3.2

README.md

+36-30
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,22 @@ Along with this there are also other commands like `pm seteditor`, `pm remove`,
2727

2828
---
2929

30-
## # Installation
30+
## Installation
3131

32-
#### ## Using NPM
33-
If you have [NodeJS](https://nodejs.org) installed in your machine
32+
With [NodeJS](https://nodejs.org) installed in your machine,
3433
```shell
3534
npm install -g projectman
3635
```
37-
**OR**
38-
39-
#### ## Download Binaries
40-
[![Download button for windows](https://img.shields.io/badge/for_windows-0099ff?style=for-the-badge&logo=windows)](https://apps.saurabhdaware.in/projectman#windows) [![Download button for Linux](https://img.shields.io/badge/for_linux-032f62?style=for-the-badge&logo=linux&logoColor=white)](https://apps.saurabhdaware.in/projectman/#linux-and-mac) [![Download button for MACOS](https://img.shields.io/badge/for_macos-111111?style=for-the-badge&logo=apple&logoColor=white)](https://apps.saurabhdaware.in/projectman/#linux-and-mac)
41-
4236

4337
---
4438

45-
## # Commands
39+
## Commands
4640
`pm` is an alias of `projectman` so you can use `pm <command>` or `projectman <command>`
4741

48-
### ## Open Project
42+
### 📖 Open Project
43+
44+
Opens project in your code editor (Check out [`pm seteditor`](#set-editor) command to set your preferred editor)
45+
4946
**Usage :**
5047
```shell
5148
pm open [projectName]
@@ -54,29 +51,36 @@ pm open [projectName]
5451

5552
**Alias:** `pm o`, `pm`
5653

57-
v1.3.0 onwards, after typing `pm open` you can start typing letters and it will autocomplete the project name.
54+
### ➕ Add Project or Template
55+
56+
Add project to favorites
5857

59-
### ## Add project
6058
```shell
6159
cd /till/the/project
6260
pm add
6361
```
6462

65-
### ## Add URL
66-
***Added in v1.3.0.***
63+
*You can pass `--url` param to add a URL instead of a directory.*
64+
65+
### 🪄 Create Project
66+
67+
Use added projects as a template to create new project
68+
6769
```shell
68-
pm add --url
70+
pm create
6971
```
70-
This command can be used to save your repositories/websites/any other important links.
71-
These links will show up in normal `pm open` with `(URL)` appended to their name.
7272

73-
### ## Set Editor
73+
**Alias:** `pm c`
74+
75+
### 💫 Set Editor
7476

7577
```shell
7678
pm seteditor
7779
```
7880
Sets default editor to open projects from.
7981

82+
To set a different editor for a specific project,
83+
8084
**Flag:** `--for-project`
8185
```shell
8286
pm seteditor --for-project
@@ -88,21 +92,24 @@ If your TextEditor/IDE is not listed, You can select option `Other` from the lis
8892
Read [editorCommand ref](#settings-ref) for more information.
8993

9094

91-
### ## `cd` to a project without opening.
95+
### 🏃🏽 `cd` to a project without opening.
9296
```shell
9397
cd $(pm getpath [projectName])
9498
```
99+
95100
`[projectName]` is an optional parameter.
101+
96102
**Alias :** `cd $(pm gp)`
103+
97104
(Note: This does not work in Windows cmd, You can use it in Windows Powershell)
98105

99-
### ## Remove Project
106+
### Remove Project
100107
```shell
101108
pm remove
102109
```
103110
Removes project from favorites.
104111

105-
### ## Remove editor
112+
### Remove editor
106113
```shell
107114
pm rmeditor
108115
```
@@ -115,7 +122,7 @@ removes all project specific editors.
115122

116123
---
117124

118-
## Settings.json
125+
## ⚙️ Settings.json
119126

120127
If you want to sort projects/change name of project/change path, You can type `pm edit` to open settings.json
121128

@@ -159,13 +166,13 @@ This will show three projects in `pm open` and project2 will be opened in Atom a
159166
| **Vim** | vim |
160167
| **WebStorm** | wstorm |
161168

162-
**> projects. name :**
169+
**> projects.`name` :**
163170
- This is the name that will be visible when you type `projectman open`
164171

165-
**> projects. path :**
172+
**> projects.`path` :**
166173
- This should be the absolute path to your folder.
167174

168-
**> projects. editor :**
175+
**> projects.`editor` :**
169176
- This is optional key. In case it doesn't exist it will read value from `commandToOpen`
170177
- You can use this to specify separate editor for a particular project.
171178
- You can set it by adding `"editor": "<commandToOpen>"` in projects array in settings.json ([Example](#settingsjson) is shown above)
@@ -174,13 +181,12 @@ This will show three projects in `pm open` and project2 will be opened in Atom a
174181

175182
## ChangeLogs
176183

177-
### v1.3.3 *[LATEST RELEASE]*
184+
### v2.0.0 *`@latest`*
185+
186+
- Add `pm create` command
187+
- Remove support for binaries
178188

179-
Command suggestions added (Thanks [@jamesgeorge007](https://github.com/jamesgeorge007) for [#PR32](https://github.com/saurabhdaware/projectman/pull/32))
180189

181-
**.
182-
.
183-
.**
184190
***For More Changes read [CHANGELOG.md](CHANGELOG.md)***
185191

186192
---

bin/index.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
const program = require('commander');
33
const { suggestCommands } = require('../lib/helper');
4-
const action = require('../lib/action');
4+
const actions = require('../lib/actions');
55

66
program.version(require('../package.json').version);
77

@@ -10,19 +10,25 @@ program
1010
.command('open [projectName]')
1111
.alias('o')
1212
.description('Open one of your saved projects')
13-
.action(action.openProject);
13+
.action(actions.openProject);
14+
15+
program
16+
.command('create [projectName]')
17+
.alias('c')
18+
.description('Create project')
19+
.action(actions.createProject);
1420

1521
program
1622
.command('add [projectDirectory]')
1723
.alias('save')
1824
.option('-u, --url [link]', 'Add a link to a repository to projects')
1925
.description('Save current directory as a project')
20-
.action(action.addProject);
26+
.action(actions.addProject);
2127

2228
program
2329
.command('remove [projectName]')
2430
.description('Remove the project')
25-
.action(action.removeProject);
31+
.action(actions.removeProject);
2632

2733
program
2834
.command('seteditor [commandToOpen]')
@@ -31,24 +37,24 @@ program
3137
'-f|--for-project [projectName]',
3238
'set different editor for specific project'
3339
)
34-
.action(action.setEditor);
40+
.action(actions.setEditor);
3541

3642
program
3743
.command('rmeditor [projectName]')
3844
.description('Remove text editor to use')
3945
.option('-a|--all', 'remove editors from all projects')
40-
.action(action.rmEditor);
46+
.action(actions.rmEditor);
4147

4248
program
4349
.command('edit')
4450
.description('Edit settings.json')
45-
.action(action.editConfigurations);
51+
.action(actions.editConfigurations);
4652

4753
program
4854
.command('getpath [projectName]')
4955
.alias('gp')
5056
.description('Get project path')
51-
.action(action.getProjectPath);
57+
.action(actions.getProjectPath);
5258

5359
program.arguments('<command>').action((command) => {
5460
console.log(`Command ${command} not found\n`);
@@ -60,7 +66,7 @@ program.usage('<command>');
6066

6167
if (process.argv.length <= 2) {
6268
// If no command mentioned then output help
63-
action.openProject();
69+
actions.openProject();
6470
}
6571

6672
// Parse arguments

0 commit comments

Comments
 (0)