c-w/ghp-import

-m probably doesn't work well with non-ascii

honzajavorek opened this issue · 1 comments

#!/bin/bash
SITENAME="Pražení"
ghp-import -m "$SITENAME :notebook_with_decorative_cover:" ./content

...results in...

fatal: Unsupported command: r:
fast-import: dumping crash report to .git/fast_import_crash_5421
Traceback (most recent call last):
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 30, in write
    pipe.stdin.write(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 198, in <module>
    main()
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 191, in main
    run_import(args[0], opts.branch, opts.mesg, opts.nojekyll)
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 148, in run_import
    add_file(pipe, fpath, gpath)
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 121, in add_file
    write(pipe, enc(data))
  File "/Users/honzajavorek/Workspace/prazeni/env/bin/ghp-import", line 32, in write
    if e.errno != errno.EPIPE:
NameError: name 'errno' is not defined
^Cmake: *** [deploy] Interrupt: 2

This should be fixed now. I had missed that the length passed wasn't calculating the byte length of encoded utf-8. 0.5.0 is tagged and on pypi if you want to test it out.