diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-28 21:25:58 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-28 21:25:58 +0200 |
commit | 826f90505c1a70ad2a8cf3715bac6d5efaeba22c (patch) | |
tree | a35600d555ff0268f6eb2fc1bd9c44c06438eb27 /lib/models/file.js | |
parent | 7ae36f16c84238340dd6b39a75423f5e95f27bbc (diff) | |
download | gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.zip gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.tar.gz gitbook-826f90505c1a70ad2a8cf3715bac6d5efaeba22c.tar.bz2 |
Add command "init"
Diffstat (limited to 'lib/models/file.js')
-rw-r--r-- | lib/models/file.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/models/file.js b/lib/models/file.js index ff7b899..d1726a7 100644 --- a/lib/models/file.js +++ b/lib/models/file.js @@ -74,5 +74,16 @@ File.createFromStat = function createFromStat(filepath, stat) { }); }; +/** + Create a file with only a path + + @param {String} filepath + @return {File} +*/ +File.createWithFilepath = function createWithFilepath(filepath) { + return new File({ + path: filepath + }); +}; module.exports = File; |