diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-01-02 12:11:46 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-01-02 12:11:46 +0000 |
commit | 04d04d8429d4c7aaf3604e2006aa86258bc5ba15 (patch) | |
tree | 292d9482a8cdad568cc0c66b97356f4fd42dcf50 /lib | |
parent | 653bba3cd6bd73876319f0d9f0b61208b46fef53 (diff) | |
download | gitano-04d04d8429d4c7aaf3604e2006aa86258bc5ba15.tar.gz |
Remove readme command, and (somewhat) empty test
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/command.lua | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua index 01a5ee9..0fa8be8 100644 --- a/lib/gitano/command.lua +++ b/lib/gitano/command.lua @@ -503,77 +503,6 @@ assert(register_cmd("config", builtin_config_short, builtin_config_validate, builtin_config_prep, builtin_config_run, true, false)) -local builtin_readme_short = "Access readme for a repository" -local builtin_readme_helptext = [[ -usage: readme <reponame> [set|show] - -If you do not provide a sub-command, the readme command defaults to -showing you the readme for the given repository. To view the -readme you must have read access to the repository. - -If you provide the subcommand 'set' then the readme command reads -from the input stream and updates the readme in the repository. -You must have the right to alter the project readme in order to do -this. -]] - -local function builtin_readme_validate(config, repo, cmdline) - if #cmdline < 2 then - log.error("Expected repository not provided") - return false - end - if not repo or repo.is_nascent then - log.error("Repository does not exist") - return false - end - if #cmdline > 3 then - log.error("usage: readme <reponame> [set|show]") - return false - end - if #cmdline == 2 then - cmdline[3] = "show" - end - if cmdline[3] ~= "set" and cmdline[3] ~= "show" then - log.error("usage: readme <reponame> [set|show]") - return false - end - return true -end - -local function builtin_readme_prep(config, repo, cmdline, context) - if cmdline[3] == "show" then - context.operation = "read" - else - context.operation = "setreadme" - end - return repo:run_lace(context) -end - -local function builtin_readme_run(config, repo, cmdline, env) - if cmdline[3] == "show" then - local t = repo.readme_mdwn - if t then - if not t:match("\n$") then - t = t .. "\n" - end - for l in t:gmatch("([^\n]*)\n") do - log.state(l) - end - else - log.state("# No README.mdwn found") - end - else - local readme = sio.stdin:read("*a") - repo:set_readme(readme, env.GITANO_USER, env.GITANO_ORIG_USER) - end - return "exit", 0 -end - -assert(register_cmd("readme", builtin_readme_short, - builtin_readme_helptext, builtin_readme_validate, - builtin_readme_prep, builtin_readme_run, - true, false)) - local builtin_destroy_short = "Destroy (delete) a repository" local builtin_destroy_helptext = [[ usage: destroy <repo> [confirmtoken] |