Skip to content

Commit

Permalink
fix: when using "--repo .@XX" and xx has no remote configured, use th…
Browse files Browse the repository at this point in the history
…e first found remote for pushing assets
  • Loading branch information
drmingdrmer committed Feb 12, 2022
1 parent c2a85e4 commit 47648d6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ md2zhihu 不支持windows, 可以通过github-action来实现远程转换:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: drmingdrmer/md2zhihu@v0.13
- uses: drmingdrmer/md2zhihu@v0.14
env:
GITHUB_USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: drmingdrmer/md2zhihu@v0.13
- uses: drmingdrmer/md2zhihu@v0.14
env:
GITHUB_USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion md2zhihu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,11 @@ def get_remote_url(self, remote=None):

if remote is None:
branch = g.head_branch(flag='x')
remote = g.branch_default_remote(branch, flag='x')
remote = g.branch_default_remote(branch, flag='n')
if remote is None:
# `branch` has no remote configured.
remote = g.cmdf("remote", flag="xo")[0]


remote_url = g.remote_get(remote, flag='x')
return remote_url
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PyYAML>=5.3.1


k3color>=0.1.2
k3down2>=0.1.15
k3down2>=0.1.16
k3fs>=0.1.5
k3git>=0.1.6
k3handy>=0.1.5
Expand Down
4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ cd ..
python setup.py install
)

PYTHONPATH="$(cd ..; pwd)" pytest -x -v
# PYTHONPATH="$(cd ..; pwd)" pytest -x -v -k test_zhihu_download
# PYTHONPATH="$(cd ..; pwd)" pytest -x -v
PYTHONPATH="$(cd ..; pwd)" pytest -x -v -k test_zhihu_download
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.13"
__version__ = "0.14"
__name__ = "md2zhihu"

0 comments on commit 47648d6

Please sign in to comment.