mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-23 20:05:11 +00:00
tools: Actually check ignored files
This commit is contained in:
parent
75e13996f1
commit
bd8a574e7a
1 changed files with 6 additions and 6 deletions
|
@ -12,7 +12,7 @@ const SECTION_START = "AUTOGENERATED COPYRIGHT HEADER START";
|
|||
const SECTION_END = "AUTOGENERATED COPYRIGHT HEADER END";
|
||||
|
||||
async function git_isIgnored(path) {
|
||||
await new Promise((resolve, reject) => {
|
||||
return await new Promise((resolve, reject) => {
|
||||
try {
|
||||
let proc = CHILD_PROCESS.spawn("git", [
|
||||
"check-ignore",
|
||||
|
@ -36,11 +36,11 @@ async function git_isIgnored(path) {
|
|||
/* Sync alternative
|
||||
try {
|
||||
return CHILD_PROCESS.spawnSync("git", [
|
||||
"check-ignore",
|
||||
"check-ignore",
|
||||
path
|
||||
], {
|
||||
"cwd": PROCESS.cwd(),
|
||||
"encoding": "utf8"
|
||||
"cwd": PROCESS.cwd(),
|
||||
"encoding": "utf8"
|
||||
}).status == 0;
|
||||
} catch (ex) {
|
||||
return true;
|
||||
|
@ -249,7 +249,7 @@ async function addCopyright(file) {
|
|||
// Async/Promises
|
||||
let content = await FSPROMISES.readFile(file);
|
||||
let eol = (content.indexOf("\r\n") != -1 ? OS.EOL : "\n");
|
||||
|
||||
|
||||
let copyright = await generateCopyright(file);
|
||||
let header = makeHeader(file, copyright);
|
||||
let insert = Buffer.from(header.join(eol) + eol);
|
||||
|
@ -258,7 +258,7 @@ async function addCopyright(file) {
|
|||
let startHeader = content.indexOf(SECTION_START);
|
||||
startHeader = content.lastIndexOf(eol, startHeader);
|
||||
startHeader += Buffer.from(eol).byteLength;
|
||||
|
||||
|
||||
// Find the ending point.
|
||||
let endHeader = content.indexOf(SECTION_END);
|
||||
endHeader = content.indexOf(eol, endHeader);
|
||||
|
|
Loading…
Reference in a new issue