data: Crear carpetas parientes a los archivos
This commit is contained in:
parent
24a1dd98a8
commit
c660c192a0
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
local utils = require "../utils"
|
||||||
local t = require "../utils/templater"
|
local t = require "../utils/templater"
|
||||||
local dirs = {}
|
local dirs = {}
|
||||||
|
|
||||||
|
@ -8,10 +9,12 @@ local function generate_mount_data()
|
||||||
if dir.type == "file" then
|
if dir.type == "file" then
|
||||||
touch(dir.mountpoint)
|
touch(dir.mountpoint)
|
||||||
string = string .. t([[
|
string = string .. t([[
|
||||||
|
mkdir -p '{{dirname}}' || exit 1
|
||||||
touch -a '{{path}}' || exit 1
|
touch -a '{{path}}' || exit 1
|
||||||
mount '{{path}}' '{{mountpoint}}' -o bind,umask=100,uid={{uid}},gid={{gid}} || exit 1
|
mount '{{path}}' '{{mountpoint}}' -o bind,umask=100,uid={{uid}},gid={{gid}} || exit 1
|
||||||
]],
|
]],
|
||||||
dir
|
{ dirname = utils.dirname(dir.path),
|
||||||
|
path = dir.path, mountpoint = dir.mountpoint, uid = dir.uid, gid = dir.gid }
|
||||||
)
|
)
|
||||||
elseif dir.type == "dir" then
|
elseif dir.type == "dir" then
|
||||||
mkdir(dir.mountpoint)
|
mkdir(dir.mountpoint)
|
||||||
|
|
Loading…
Reference in a new issue