Permalink
Browse files

Added 'agner create' command to simply process of creating new .agner…

… repos
  • Loading branch information...
1 parent f645a4d commit 1563446fcc2371d10869b1900b92cb091b02422c @yrashk yrashk committed Feb 1, 2011
Showing with 24 additions and 0 deletions.
  1. +5 −0 README.md
  2. +19 −0 src/agner_main.erl
View
@@ -161,6 +161,11 @@ Prints prefix where package is installed. If package is not installed, prints no
Shows main environmental variables. If `VARIABLES` is omitted, then lists `key=value` for each variable. If not omitted,
prints just its value. Currently supported variables are: `prefix` and `bin`.
+ agner create PACKAGE [--github-account ACCOUNT]
+
+Contributor's tool that clones `.agner` repo template and sets its origin to ACCOUNT (by default, equals `agner`,
+so if you don't have a permission to create repos in `agner`, set --github-account to your personal or organization account.
+
agner verify [SPEC FILENAME (agner.config by default)]
Verify specification file for correctness; intended to be used to package maintainers to simplify
View
@@ -98,6 +98,13 @@ arg_proplist() ->
{install, $i, "install", {boolean, false}, "Install package (if install_command is available)"},
{directory, undefined, undefined, string, "Directory to check package out to"}
]}},
+ {"create",
+ {create,
+ "Create new .agner repository",
+ [
+ {package, undefined, undefined, string, "Package name"},
+ {github_account, undefined, "github-account",{string, "agner"}, "GitHub account to set as origin"}
+ ]}},
{"verify",
{verify,
"Verify the integrity of an .agner configuration file",
@@ -416,6 +423,18 @@ handle_command(fetch, Opts) ->
end
end;
+handle_command(create, Opts) ->
+ case proplists:get_value(package, Opts) of
+ undefined ->
+ io:format("ERROR: Package name required.~n");
+ Package ->
+ Dir = filename:absname(Package ++ ".agner"),
+ ClonePort = agner_download:git(["clone","-q","https://github.com/agner/agner.template.git",Dir]),
+ agner_download:process_port(ClonePort, fun() ->
+ agner_download:git(["config","remote.origin.url","git@github.com:" ++ proplists:get_value(github_account, Opts) ++ "/" ++ Package ++ ".agner.git"],[{cd, Dir}])
+ end)
+ end;
+
handle_command(verify, Opts) ->
SpecFile = proplists:get_value(spec, Opts),
case file:consult(SpecFile) of

0 comments on commit 1563446

Please sign in to comment.