Skip to content

Commit c903138

Browse files
committed
Merge pull request #2 from TypesettingTools/fileops-attribute-consolidation
FileOps: use FileOps.attributes instead of lfs.attributes in mkdir.
2 parents bf6253c + ab47552 commit c903138

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

modules/DependencyControl/FileOps.moon

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,11 @@ class FileOps
235235
return true
236236

237237
mkdir: (path, isFile) ->
238-
path, dev, dir, file = FileOps.validateFullPath path
239-
unless path
240-
return nil, msgs.attributes.badPath\format dev
241-
dir = isFile and table.concat({dev,dir or file}) or path
238+
mode, fullPath, dev, dir, file = FileOps.attributes path, "mode"
239+
dir = isFile and table.concat({dev,dir or file}) or fullPath
242240

243-
mode, err = lfs.attributes dir, "mode"
244-
if err
245-
return nil, msgs.attributes.genericError\format err
241+
if mode == nil
242+
return nil, msgs.attributes.genericError\format fullPath
246243
elseif not mode
247244
res, err = lfs.mkdir dir
248245
if err -- can't create directory (possibly a permission error)

0 commit comments

Comments
 (0)