diff options
| author | Michael Forney <mforney@mforney.org> | 2020-05-17 01:13:14 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-05-17 01:13:14 -0700 |
| commit | f420887253711d85af07905e67ef39eee41d386a (patch) | |
| tree | 6d1362e3cf0fb230d0dc863a80a80ad493da9fa5 /setup.lua | |
| parent | e7487ef31b5bda6962ee2ce860b6aba78fcbd2fb (diff) | |
Use assert in a few places
Diffstat (limited to 'setup.lua')
| -rwxr-xr-x | setup.lua | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -56,13 +56,9 @@ function gen(dir) }, perms={}, } - if not os.execute('mkdir -p '..dir) then - error('failed to create '..dir) - end + assert(os.execute('mkdir -p '..dir)) local outdir = config.builddir..'/'..dir - if not os.execute('mkdir -p '..outdir) then - error('failed to create '..outdir) - end + assert(os.execute('mkdir -p '..outdir)) io.output(dir..'/local.ninja.tmp') set('gendir', dir) if dir ~= '.' then @@ -94,7 +90,7 @@ function gen(dir) table.sort(pkg.perms, function(s1, s2) return s1:sub(8) < s2:sub(8) end) - local f = io.open(outdir..'/local.perms', 'w') + local f = assert(io.open(outdir..'/local.perms', 'w')) table.insert(pkg.perms, '') f:write(table.concat(pkg.perms, '\n')) table.insert(pkg.inputs.perms, '$outdir/local.perms') |
