-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional lint checks before publishing (#5459)
- Loading branch information
Showing
15 changed files
with
94 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
const path = require('path') | ||
const { execSync } = require("child_process"); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
function main() { | ||
const repoDir = path.dirname(__dirname) | ||
const gitDir = path.join(repoDir, '.git') | ||
const gitDirExists = doesDirectoryExist(gitDir) | ||
const repoDir = path.dirname(__dirname); | ||
const gitDir = path.join(repoDir, '.git'); | ||
const gitDirExists = doesDirectoryExist(gitDir); | ||
if (!gitDirExists) { | ||
console.log("No .git directory detected so can not clean 'lib/'. Exiting.") | ||
process.exit(0) | ||
console.log("No .git directory detected so can not clean 'lib/'. Exiting."); | ||
process.exit(0); | ||
} | ||
console.log("Cleaning 'lib/' of outputted files from Typescript compilation ...") | ||
const cmd = 'git clean -f -X lib/' | ||
const output = execSync(cmd, { cwd: repoDir }) | ||
console.log(output.toString('utf8')) | ||
console.log('Done') | ||
console.log( | ||
"Cleaning 'lib/' of outputted files from Typescript compilation ..." | ||
); | ||
const cmd = 'git clean -f -X lib/'; | ||
const output = execSync(cmd, { cwd: repoDir }); | ||
console.log(output.toString('utf8')); | ||
console.log('Done'); | ||
} | ||
|
||
function doesDirectoryExist(p) { | ||
if (fs.existsSync(p)) { | ||
return fs.lstatSync(p).isDirectory() | ||
return fs.lstatSync(p).isDirectory(); | ||
} | ||
return false | ||
return false; | ||
} | ||
|
||
main() | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters