diff --git a/cmd/feature.ab b/cmd/feature.ab index 34743a6..39dd225 100644 --- a/cmd/feature.ab +++ b/cmd/feature.ab @@ -1,9 +1,23 @@ +import * from "../config.ab" + +fun branch(feature: Text): Text { + let prefix = get_feature_prefix() + + return "{prefix}{feature}" +} + fun feature_start(feature: Text, description: Text): Null { - echo "Create feature {feature} ({description})" + let branch = branch(feature) + let base = get_dev_branch() + + echo "git switch -c {branch} {base}" + echo "git config --no-add branch.\"{branch}\".description \"{description}\"" } fun feature_checkout(feature: Text): Null { - echo "Checkout feature {feature}" + let branch = branch(feature) + + echo "git checkout \"{branch}\"" } fun feature_publish(feature: Text): Null { diff --git a/config.ab b/config.ab new file mode 100644 index 0000000..83caf1b --- /dev/null +++ b/config.ab @@ -0,0 +1,11 @@ +pub fun get_feature_prefix(): Text { + return "feature/" +} + +pub fun get_dev_branch(): Text { + return "develop" +} + +pub fun get_push_remote(): Text { + return "origin" +} \ No newline at end of file