removed fs-extra dependancy

This commit is contained in:
Alfred Wärnsäter
2021-08-06 11:02:55 +02:00
parent 730b2dd874
commit 1924cd1822
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ var /* FILE = require("file"), */
Jake = require("objj-jake"), Jake = require("objj-jake"),
BundleTask = (require("./bundletask")).BundleTask; BundleTask = (require("./bundletask")).BundleTask;
var fs = require("fs-extra"); var fs = require("fs");
var path = require("path"); var path = require("path");
function ApplicationTask(aName) function ApplicationTask(aName)
@@ -99,7 +99,7 @@ ApplicationTask.prototype.defineFrameworksTask = function()
tempPath = path.join(process.cwd(), ".__capp_Frameworks_Source__"); tempPath = path.join(process.cwd(), ".__capp_Frameworks_Source__");
if (hasSource) if (hasSource)
fs.moveSync(sourcePath, tempPath); fs.moveSync(sourcePath, tempPath);
fs.copySync(thisTask._frameworksPath, newFrameworks, { recursive: true }); copyRecursiveSync(thisTask._frameworksPath, newFrameworks);
if (hasSource) if (hasSource)
fs.moveSync(tempPath, sourcePath); fs.moveSync(tempPath, sourcePath);
} }); } });
+3 -3
View File
@@ -25,7 +25,7 @@ const child_process = require("child_process");
const path = require("path"); const path = require("path");
// NPM modules // NPM modules
const fs = require("fs-extra"); const fs = require("fs");
const ObjectiveJ = require("objj-runtime"); const ObjectiveJ = require("objj-runtime");
const term = require("objj-runtime").term; const term = require("objj-runtime").term;
@@ -437,9 +437,9 @@ BundleTask.prototype.defineResourceTask = function(aResourcePath, aDestinationPa
catch(anException) { catch(anException) {
} }
if (fs.lstatSync(aResourcePath).isDirectory()) if (fs.lstatSync(aResourcePath).isDirectory())
fs.copySync(aResourcePath, aDestinationPath, { recursive: true }); copyRecursiveSync(aResourcePath, aDestinationPath);
else else
fs.copySync(aResourcePath, aDestinationPath); fs.copyFileSync(aResourcePath, aDestinationPath);
}); });
this.enhance([aDestinationPath]); this.enhance([aDestinationPath]);
} if ((extension === ".xib" || extension === ".nib") && !this._preventsNib2Cib) } if ((extension === ".xib" || extension === ".nib") && !this._preventsNib2Cib)
+4 -4
View File
@@ -32,7 +32,7 @@ var OBJJ = require("objj-runtime"),
// FIXME: lots of chaining using narwhals path wrapper, this file might still be broken // FIXME: lots of chaining using narwhals path wrapper, this file might still be broken
var fs = require("fs-extra"); var fs = require("fs");
var node_path = require("path"); var node_path = require("path");
var child_process = require("child_process"); var child_process = require("child_process");
var jake = require("objj-jake"); var jake = require("objj-jake");
@@ -177,7 +177,7 @@ function gen(/*va_args*/)
else if (!fs.existsSync(destinationProject)) else if (!fs.existsSync(destinationProject))
{ {
// FIXME??? // FIXME???
fs.copySync(sourceTemplate, destinationProject, { recursive: true }); copyRecursiveSync(sourceTemplate, destinationProject);
var files = (new jake.FileList(node_path.join(destinationProject, "**", "*"))).toArray(), var files = (new jake.FileList(node_path.join(destinationProject, "**", "*"))).toArray(),
count = files.length, count = files.length,
@@ -347,7 +347,7 @@ function installFramework(source, dest, force, symlink)
if (symlink) if (symlink)
fs.symlinkSync(source, dest); fs.symlinkSync(source, dest);
else else
fs.copySync(source, dest, { recursive: true }); copyRecursiveSync(source, dest);
} }
else else
warn("Cannot find: " + logPath(source)); warn("Cannot find: " + logPath(source));
@@ -408,7 +408,7 @@ function installTheme(source, dest, force, symlink)
if (symlink) if (symlink)
fs.symlinkSync(source, dest); fs.symlinkSync(source, dest);
else else
fs.copySync(source, dest, { recursive: true }); copyRecursiveSync(source, dest);
} }
else else
warn("Cannot find: " + logPath(source)); warn("Cannot find: " + logPath(source));
+1 -1
View File
@@ -217,7 +217,7 @@ global.rm_rf = function(/*String*/ aFilename)
// from stackoverflow // from stackoverflow
function copyRecursiveSync (src, dest) { global.copyRecursiveSync = function (src, dest) {
var exists = fs.existsSync(src); var exists = fs.existsSync(src);
var stats = exists && fs.statSync(src); var stats = exists && fs.statSync(src);
var isDirectory = exists && stats.isDirectory(); var isDirectory = exists && stats.isDirectory();