now can remove files
This commit is contained in:
		| @@ -10,6 +10,7 @@ import SmartfileRemote = require("./smartfile.remote"); | ||||
|  | ||||
| var smartfile:any = { | ||||
|     fsaction: SmartfileFsaction, | ||||
|     fs: plugins.fs, | ||||
|     checks: SmartfileChecks, | ||||
|     get: SmartfileGet, | ||||
|     local: SmartfileLocal, | ||||
|   | ||||
| @@ -30,3 +30,11 @@ export let fileExists = function(filePath){ | ||||
|     }); | ||||
|     return done.promise; | ||||
| }; | ||||
|  | ||||
| export let isDirectory = function(pathArg):boolean{ | ||||
|     return plugins.fs.statSync(pathArg).isDirectory(); | ||||
| }; | ||||
|  | ||||
| export let isFile = function(pathArg):boolean{ | ||||
|     return plugins.fs.statSync(pathArg).isFile(); | ||||
| }; | ||||
|   | ||||
| @@ -1,7 +1,30 @@ | ||||
| /// <reference path="./typings/main.d.ts" /> | ||||
|  | ||||
| import plugins = require("./smartfile.plugins"); | ||||
| import SmartfileChecks = require("./smartfile.checks"); | ||||
|  | ||||
| export let copy = function(fromArg:string,toArg:string){ | ||||
|     plugins.shelljs.cp("-r",fromArg,toArg); | ||||
| export let copy = function(fromArg:string, toArg:string){ | ||||
|     var done = plugins.q.defer(); | ||||
|     plugins.fs.copy(fromArg,toArg,{},function(){ | ||||
|         done.resolve(); | ||||
|     }); | ||||
|     return done.promise; | ||||
| }; | ||||
|  | ||||
| export let copySync = function(fromArg:string,toArg:string):boolean{ | ||||
|     plugins.fs.copySync(fromArg,toArg); | ||||
|     return true; | ||||
| }; | ||||
|  | ||||
| export let remove = function(pathArg:string){ | ||||
|     var done = plugins.q.defer(); | ||||
|     plugins.fs.remove(pathArg,function(){ | ||||
|         done.resolve(); | ||||
|     }); | ||||
|     return done.promise; | ||||
| }; | ||||
|  | ||||
| export let removeSync = function(pathArg:string):boolean{ | ||||
|     plugins.fs.removeSync(pathArg); | ||||
|     return true; | ||||
| }; | ||||
| @@ -12,4 +12,3 @@ export let vinylFile = require("vinyl-file"); | ||||
| export let yaml = require("js-yaml"); | ||||
| export let request = require("request"); | ||||
| export let requireReload = require("require-reload"); | ||||
| export let shelljs = require("shelljs"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user