-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#5] @naverpay/markdown-lint 패키지를 추가합니다 #6
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고고고~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~! 확인이 늦었습니다 ㅠ
감사합니다!
#!/usr/bin/env node | ||
const {execSync} = require('child_process') | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const createConfigFile = (dirname, fileName, destFileName = fileName) => { | ||
try { | ||
const source = path.join(dirname, fileName) | ||
const config = fs.readFileSync(source) | ||
|
||
const gitRoot = execSync('git rev-parse --show-toplevel').toString().trim() | ||
const dest = path.join(gitRoot, destFileName) | ||
|
||
if (fs.existsSync(dest)) { | ||
process.exit(0) | ||
} | ||
fs.writeFileSync(dest, config) | ||
console.log(`${destFileName} is created successfully`) | ||
} catch (error) { | ||
console.log(`Failed to create ${destFileName}`) | ||
console.log(error?.message) | ||
process.exit(0) | ||
} | ||
} | ||
|
||
module.exports = { | ||
createConfigFile, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요기로 옮겨갔군요!
이견 없습니다~
Related Issue
Request
workspace
를 참조하도록 합니다.