smartfile/dist/smartfile.fsaction.js

28 lines
3.0 KiB
JavaScript
Raw Normal View History

2016-03-18 09:19:46 +00:00
/// <reference path="./typings/main.d.ts" />
"use strict";
var plugins = require("./smartfile.plugins");
exports.copy = function (fromArg, toArg) {
2016-03-20 23:28:29 +00:00
var done = plugins.q.defer();
plugins.fs.copy(fromArg, toArg, {}, function () {
done.resolve();
});
return done.promise;
};
exports.copySync = function (fromArg, toArg) {
plugins.fs.copySync(fromArg, toArg);
return true;
};
exports.remove = function (pathArg) {
var done = plugins.q.defer();
plugins.fs.remove(pathArg, function () {
done.resolve();
});
return done.promise;
};
exports.removeSync = function (pathArg) {
plugins.fs.removeSync(pathArg);
return true;
2016-03-18 09:19:46 +00:00
};
2016-03-20 23:28:29 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5mc2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7O0FBRTVDLElBQU8sT0FBTyxXQUFXLHFCQUFxQixDQUFDLENBQUM7QUFHckMsWUFBSSxHQUFHLFVBQVMsT0FBYyxFQUFFLEtBQVk7SUFDbkQsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixPQUFPLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUMsS0FBSyxFQUFDLEVBQUUsRUFBQztRQUM3QixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDbkIsQ0FBQyxDQUFDLENBQUM7SUFDSCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUM7QUFFUyxnQkFBUSxHQUFHLFVBQVMsT0FBYyxFQUFDLEtBQVk7SUFDdEQsT0FBTyxDQUFDLEVBQUUsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFDLEtB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