Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 4d81a42

Browse files
committed
fix(cli): validate the base path
1 parent 2e17f32 commit 4d81a42

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

packages/fusuma/CHANGELOG.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
55

66
# [2.0.0-alpha.5](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2021-01-19)
77

8-
98
### Features
109

11-
* **cli:** add basePath option ([1bbee94](https://github.com/hiroppy/fusuma/commit/1bbee94ab9f014df26cf9f4ae0f7f0130a7a5ce9))
12-
13-
14-
15-
10+
- **cli:** add basePath option ([1bbee94](https://github.com/hiroppy/fusuma/commit/1bbee94ab9f014df26cf9f4ae0f7f0130a7a5ce9))
1611

1712
# [2.0.0-alpha.4](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2021-01-19)
1813

19-
2014
### Bug Fixes
2115

22-
* **build:** modify screenshot logic ([735edfb](https://github.com/hiroppy/fusuma/commit/735edfb1bbb13bdbbda4ddab6e798fbc2a917663))
23-
* some bugs ([3191dcc](https://github.com/hiroppy/fusuma/commit/3191dcc2a8e9c8aab360071d0756ce7141163ee4))
24-
25-
26-
27-
16+
- **build:** modify screenshot logic ([735edfb](https://github.com/hiroppy/fusuma/commit/735edfb1bbb13bdbbda4ddab6e798fbc2a917663))
17+
- some bugs ([3191dcc](https://github.com/hiroppy/fusuma/commit/3191dcc2a8e9c8aab360071d0756ce7141163ee4))
2818

2919
# [1.16.0](https://github.com/hiroppy/fusuma/compare/v1.15.2...v1.16.0) (2020-02-17)
3020

packages/fusuma/src/cli/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function cli() {
6262
type: 'deploy',
6363
options: {
6464
basePath: options.b,
65-
outputDir: options.i
65+
outputDir: options.i,
6666
},
6767
});
6868
})

packages/fusuma/src/tasks/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { join } = require('path');
3+
const { join, isAbsolute } = require('path');
44
const fusuma = require('../configs/fusumarc');
55
const init = require('./init');
66
const start = require('./start');
@@ -9,7 +9,10 @@ const deploy = require('./deploy');
99
const pdf = require('./pdf');
1010

1111
async function tasks({ type, options }) {
12-
const { basePath, inputDir, outputDir } = options;
12+
const { inputDir, outputDir } = options;
13+
const basePath = isAbsolute(options.basePath)
14+
? options.basePath
15+
: join(process.cwd(), options.basePath);
1316
const inputDirPath = join(basePath, inputDir || 'slides');
1417
const outputDirPath = join(basePath, outputDir || 'dist');
1518
let config = {};

0 commit comments

Comments
 (0)