DiamondLightSource / python-copier-template

Diamond's opinionated copier template for pure Python projects managed by pip
Apache License 2.0
5 stars 3 forks source link

add cd into tasks #113

Closed gilesknap closed 9 months ago

gilesknap commented 9 months ago

I've seen two issues with creating a new folder from scratch:

  1. you must supply a full path for the folder in the copier command line - otherwise it appears in /
  2. cwd will not be in the new folder so the tasks will fail

This PR is a fix for 2.

I also have in my own templates:

    # Add the remote if it doesn't exist
    - if ! git remote | grep origin; then git remote add origin {{repo_url}}; fi

That way you can just do a push after creation. If it is gitlab at DLS then you can do a push without first creating the repo (maybe thats a little too good?).

I did not add the above into this PR because I note that your repo_url internal value looks to be hardcoded for github, but that could be fixed.

Here is what I do https://github.com/epics-containers/ec-services-template/blob/98062b36abd4a61d55df68d2f6ac9362df7273b2/copier.yml#L142-L150

This explicitly exposes the repo URI so the user could override if wanted.

gilesknap commented 9 months ago

Closing this as your template does not exhibit the two issues I mention.