Hi My first post on any forum hope it goes well,
I am trying to make a workflow to help me use git for my job, I am trying to make a script filter which lists remote branches, I need to import git from GitPython.
I have installed script inside workflow directory using pip3
ran this in my workflow root.
pip install --target . gitpython
file system looks like this in my workflow folder:
. gitdb-4.0.10.dist-info
.. info.plist
GitPython-3.1.36.dist-info smmap
git smmap-5.0.0.dist-info
gitdb
my script filter looks like this
import sys
import json
from git import git
r = Repo('~/Workspaces/apollo')
remote_refs = r.remote().refs
for refs in remote_refs:
print(refs.name)
subtitle = ' '.join(refs)
query = sys.argv[1]
out = {"items": [
{
"uid": "desktop",
"type": "file",
"title": query,
"subtitle": "sub" + subtitle,
"arg": "123",
"autocomplete": "Desktop",
"icon": {
"type": "fileicon",
"path": "~/Desktop"
}
}
]}
sys.stdout.write(json.dumps(out))
when I debug my flow I get this error:
line 3, in <module>
from git import git
ModuleNotFoundError: No module named 'git'
also one question I have because I am not very proficient with python, if anyone can inform me why does alfred's script filter not import modules installed globally, like any other script on my machine.
Thanks in advance