metanorma / metanorma-ogc

Metanorma processor for OGC documents
https://www.metanorma.com
BSD 2-Clause "Simplified" License
2 stars 3 forks source link

Console output says 'Invalid template reoository!' when generating template #596

Closed ghobona closed 1 year ago

ghobona commented 1 year ago

When running the following command...

docker run --rm -v "$(pwd)":/metanorma metanorma/metanorma metanorma new -d standard -t ogc -l https://github.com/metanorma/metanorma-templates-ogc folder_for_standard

The template is generated but the top of the console output reads Invalid template reoository!.

See attached.

Screenshot 2023-10-27 at 23 20 38
opoudjis commented 1 year ago

The error is being triggered by this check in metanorma-cli:

https://github.com/metanorma/metanorma-cli/blob/c427853eb2f98135ad331cd2442da0dee0a55a33/lib/metanorma/cli/git_template.rb#L16C7-L22C10

def download
        remove!
        clone_git_template(options[:repo])
      rescue Git::GitExecuteError
        UI.say("Invalid template reoository!")
        nil
      end

That code (which I did not write, four years ago) is failing to print what the error actually is, and that is going to change now.

When you do print what the error is, you find that it is:

output: "Cloning into '/Users/nickn/.metanorma/templates/git/ogc'...\nremote: Repository not found.
fatal: repository 'https://github.com/metanorma/metanorma-templates-ogc/' not found"!

And indeed, @ghobona , you got the URL of the repo wrong. It is https://github.com/metanorma/mn-templates-ogc