Open Krinopotam opened 2 weeks ago
It seems to be an error occurring on Windows. I have temporarily resolved it by modifying the file as follows:
By replacing the Git.prototype.rm section in the node_modules\gh-pages\lib\git.js file with the code below, the issue is resolved.
const os = require('os');
/**
* Remove all unversioned files.
* @param {string | Array<string>} files Files argument.
* @return {Promise} A promise.
*/
Git.prototype.rm = function (files) {
if (!Array.isArray(files)) {
files = [files];
}
if(os.platform() ==='win32'){
return separateRm(this, files);
} else{
return this.exec('rm', '--ignore-unmatch', '-r', '-f', ...files);
}
};
/**
* files separate deletion
*
* @param {Git} thisObj git
* @param {Array} files files Files argument
* @returns
*/
async function separateRm (thisObj , files ) {
const limitFileCount = 100;
const fileLength = files.length;
let loopCount = Math.ceil(fileLength /limitFileCount);
let startIdx = 0;
const allExecResult =[];
let endIdx =limitFileCount;
for(let i =0;i <loopCount; i++){
if(endIdx > fileLength){
endIdx = fileLength-1;
}
let rmFiles = files.slice(startIdx, endIdx);
allExecResult.push(await thisObj.exec('rm', '--ignore-unmatch', '-r', '-f', ...rmFiles));
startIdx = endIdx;
endIdx = endIdx+ limitFileCount;
}
return allExecResult[allExecResult.length-1];
}
After updating to version 6.2.0, when I call the
gh-pages --nojekyll -d deploy
command, I get the following error: