Skip to content

Instantly share code, notes, and snippets.

@pine
Created February 12, 2015 10:58
Show Gist options
  • Save pine/705b053045f93020d060 to your computer and use it in GitHub Desktop.
Save pine/705b053045f93020d060 to your computer and use it in GitHub Desktop.
touch command for NYAGOS. License: Public Domain.
nyagos.alias('touch', function(args)
if #args <= 0 then
print 'Usage: touch FILENAME'
return
end
local fd = io.open(args[1])
if fd then
fd:close()
else
io.open(args[1], 'w'):close()
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment