mdboard 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin.js +5 -17
  2. package/package.json +1 -1
  3. package/src/cli/init.js +15 -2
package/bin.js CHANGED
@@ -40,34 +40,22 @@ if (command === '--help' || command === '-h' || command === 'help') {
40
40
  process.exit(0);
41
41
  }
42
42
 
43
- // --- Init ---
43
+ // --- Command dispatch ---
44
44
  if (command === 'init') {
45
45
  require('./src/cli/init');
46
46
  // init.js manages its own process.exit via async readline callbacks
47
- }
48
-
49
- // --- Cache ---
50
- if (command === 'cache') {
47
+ } else if (command === 'cache') {
51
48
  handleCache();
52
49
  process.exit(0);
53
- }
54
-
55
- // --- History ---
56
- if (command === 'history') {
50
+ } else if (command === 'history') {
57
51
  handleHistory();
58
52
  process.exit(0);
59
- }
60
-
61
- // --- Status ---
62
- if (command === 'status') {
53
+ } else if (command === 'status') {
63
54
  const { resolveProjectDir } = require('./src/cli/cli');
64
55
  const { generateStatus } = require('./src/cli/status');
65
56
  generateStatus(resolveProjectDir(args));
66
57
  process.exit(0);
67
- }
68
-
69
- // --- CRUD: create, update, delete ---
70
- if (command === 'create') {
58
+ } else if (command === 'create') {
71
59
  const { resolveProjectDir, handleCreate } = require('./src/cli/cli');
72
60
  handleCreate(resolveProjectDir(args), args.slice(1));
73
61
  } else if (command === 'update') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdboard",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Git-based project management dashboard. Reads markdown files with YAML frontmatter and serves a visual kanban board, table, milestones, and metrics views.",
5
5
  "main": "./src/server/server.js",
6
6
  "bin": {
package/src/cli/init.js CHANGED
@@ -23,8 +23,6 @@ const args = process.argv.slice(2).filter(a => a !== 'init');
23
23
 
24
24
  // Parse flags
25
25
  const preset = process.env.MDBOARD_PRESET || parseFlag('preset') || configEngine.DEFAULT_PRESET;
26
- const nameArg = args.filter(a => !a.startsWith('--'))[0] || '';
27
-
28
26
  function parseFlag(flag) {
29
27
  for (let i = 0; i < args.length; i++) {
30
28
  if (args[i] === '--' + flag && args[i + 1]) return args[i + 1];
@@ -32,6 +30,21 @@ function parseFlag(flag) {
32
30
  return null;
33
31
  }
34
32
 
33
+ // Collect positional args (skip flag values)
34
+ function getPositionalArgs() {
35
+ const positional = [];
36
+ for (let i = 0; i < args.length; i++) {
37
+ if (args[i].startsWith('--')) {
38
+ i++; // skip the flag's value
39
+ } else {
40
+ positional.push(args[i]);
41
+ }
42
+ }
43
+ return positional;
44
+ }
45
+
46
+ const nameArg = getPositionalArgs()[0] || '';
47
+
35
48
  // Check if project already exists
36
49
  if (fs.existsSync(projectPath)) {
37
50
  console.log('\n project/ already exists at ' + projectPath);