mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-27 13:53:01 +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";
|
const SECTION_END = "AUTOGENERATED COPYRIGHT HEADER END";
|
||||||
|
|
||||||
async function git_isIgnored(path) {
|
async function git_isIgnored(path) {
|
||||||
await new Promise((resolve, reject) => {
|
return await new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
let proc = CHILD_PROCESS.spawn("git", [
|
let proc = CHILD_PROCESS.spawn("git", [
|
||||||
"check-ignore",
|
"check-ignore",
|
||||||
|
@ -36,11 +36,11 @@ async function git_isIgnored(path) {
|
||||||
/* Sync alternative
|
/* Sync alternative
|
||||||
try {
|
try {
|
||||||
return CHILD_PROCESS.spawnSync("git", [
|
return CHILD_PROCESS.spawnSync("git", [
|
||||||
"check-ignore",
|
"check-ignore",
|
||||||
path
|
path
|
||||||
], {
|
], {
|
||||||
"cwd": PROCESS.cwd(),
|
"cwd": PROCESS.cwd(),
|
||||||
"encoding": "utf8"
|
"encoding": "utf8"
|
||||||
}).status == 0;
|
}).status == 0;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -249,7 +249,7 @@ async function addCopyright(file) {
|
||||||
// Async/Promises
|
// Async/Promises
|
||||||
let content = await FSPROMISES.readFile(file);
|
let content = await FSPROMISES.readFile(file);
|
||||||
let eol = (content.indexOf("\r\n") != -1 ? OS.EOL : "\n");
|
let eol = (content.indexOf("\r\n") != -1 ? OS.EOL : "\n");
|
||||||
|
|
||||||
let copyright = await generateCopyright(file);
|
let copyright = await generateCopyright(file);
|
||||||
let header = makeHeader(file, copyright);
|
let header = makeHeader(file, copyright);
|
||||||
let insert = Buffer.from(header.join(eol) + eol);
|
let insert = Buffer.from(header.join(eol) + eol);
|
||||||
|
@ -258,7 +258,7 @@ async function addCopyright(file) {
|
||||||
let startHeader = content.indexOf(SECTION_START);
|
let startHeader = content.indexOf(SECTION_START);
|
||||||
startHeader = content.lastIndexOf(eol, startHeader);
|
startHeader = content.lastIndexOf(eol, startHeader);
|
||||||
startHeader += Buffer.from(eol).byteLength;
|
startHeader += Buffer.from(eol).byteLength;
|
||||||
|
|
||||||
// Find the ending point.
|
// Find the ending point.
|
||||||
let endHeader = content.indexOf(SECTION_END);
|
let endHeader = content.indexOf(SECTION_END);
|
||||||
endHeader = content.indexOf(eol, endHeader);
|
endHeader = content.indexOf(eol, endHeader);
|
||||||
|
|
Loading…
Reference in a new issue