|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
545 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict'
|
|---|
| 2 | const fs = require('../fs')
|
|---|
| 3 | const { checkPath } = require('./utils')
|
|---|
| 4 |
|
|---|
| 5 | const getMode = options => {
|
|---|
| 6 | const defaults = { mode: 0o777 }
|
|---|
| 7 | if (typeof options === 'number') return options
|
|---|
| 8 | return ({ ...defaults, ...options }).mode
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | module.exports.makeDir = async (dir, options) => {
|
|---|
| 12 | checkPath(dir)
|
|---|
| 13 |
|
|---|
| 14 | return fs.mkdir(dir, {
|
|---|
| 15 | mode: getMode(options),
|
|---|
| 16 | recursive: true
|
|---|
| 17 | })
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | module.exports.makeDirSync = (dir, options) => {
|
|---|
| 21 | checkPath(dir)
|
|---|
| 22 |
|
|---|
| 23 | return fs.mkdirSync(dir, {
|
|---|
| 24 | mode: getMode(options),
|
|---|
| 25 | recursive: true
|
|---|
| 26 | })
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.