This repository was archived by the owner on Mar 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,19 @@ def existing(args):
179179 )
180180
181181
182+ def clean_repo (args ):
183+ path : Path = args .path
184+
185+ assert path .is_dir (), f"Expected { path } to be an existing directory"
186+
187+ branches = [x [2 :] for x in str (git ("branch" , "--list" )).split ("\n " )]
188+ assert "skeleton-merge-branch" in branches , \
189+ "Expected skeleton-merge-branch to be in existing repo"
190+
191+ git ("branch" , "-D" , "skeleton-merge-branch" )
192+ print ("skeleton-merge-branch deleted from existing repo" )
193+
194+
182195def main (args = None ):
183196 parser = ArgumentParser ()
184197 subparsers = parser .add_subparsers ()
@@ -209,6 +222,10 @@ def main(args=None):
209222 sub .add_argument (
210223 "--package" , default = None , help = "Package name, defaults to directory name"
211224 )
225+ # Add a command for cleaning an existing repo of skeleton code
226+ sub = subparsers .add_parser ("clean" , help = "Clean skeleton from existing repo" )
227+ sub .set_defaults (func = clean_repo )
228+ sub .add_argument ("path" , type = Path , help = "Path to existing repo with skeleton code" )
212229 # Parse args and run
213230 args = parser .parse_args (args )
214231 args .func (args )
You can’t perform that action at this time.
0 commit comments