Skip to content

Commit 7457c5c

Browse files
authored
Merge pull request #41 from contentstack/fix/sre
fixed sre issue
2 parents df15359 + 4b50773 commit 7457c5c

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-content-type/issues",
77
"dependencies": {
88
"@contentstack/cli-command": "^1.2.17",
9-
"@contentstack/cli-utilities": "^1.6.1",
9+
"@contentstack/cli-utilities": "^1.6.2",
1010
"@types/diff2html": "^3.0.0",
1111
"@types/git-diff": "^2.0.2",
1212
"@types/hogan.js": "^3.0.0",

src/core/content-type/diagram.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ DiagramNodeType,
1212
Format
1313
} from '../../types'
1414

15+
import { sanitizePath } from '@contentstack/cli-utilities';
16+
1517
const theme = {
1618
graph: {
1719
fontname: 'Helvetica',
@@ -290,7 +292,7 @@ function flattenFields(fields: DiagramNodeField[], depth = 0, prefix = '') {
290292
}
291293

292294
function createOutputPath(outputFile: string) {
293-
const outputPath = path.resolve(process.cwd(), outputFile)
295+
const outputPath = path.resolve(sanitizePath(process.cwd()), sanitizePath(outputFile))
294296
const dirName = path.dirname(outputPath)
295297

296298
fs.mkdirSync(dirName, {recursive: true})

0 commit comments

Comments
 (0)