Skip to content

Commit

Permalink
Move $dir/local.perms -> $outdir/local.perms
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelforney committed Oct 24, 2017
1 parent e5cfa84 commit 2fce3c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -3,5 +3,4 @@
/out
fetch
local.ninja
local.perms
.*.swp
8 changes: 6 additions & 2 deletions setup.lua
Expand Up @@ -46,6 +46,10 @@ function gen(dir)
},
perms={},
}
local outdir = config.builddir..'/'..dir
if not os.execute('mkdir -p '..outdir) then
error('failed to create '..outdir)
end
io.output(dir..'/local.ninja.tmp')
set('dir', dir)
if dir ~= '.' then
Expand Down Expand Up @@ -76,10 +80,10 @@ function gen(dir)
table.sort(pkg.perms, function(s1, s2)
return s1:sub(8) < s2:sub(8)
end)
local f = io.open(dir..'/local.perms', 'w')
local f = io.open(outdir..'/local.perms', 'w')
table.insert(pkg.perms, '')
f:write(table.concat(pkg.perms, '\n'))
table.insert(pkg.inputs.perms, '$dir/local.perms')
table.insert(pkg.inputs.perms, '$outdir/local.perms')
f:close()
end
if next(pkg.inputs.perms) then
Expand Down

0 comments on commit 2fce3c2

Please sign in to comment.