我有一个最简单的脚本update.sh#!/bin/sh
cd /home/pi/circulation_of_circuits
git pull
当我用./update.sh从终端调用它时,我得到一个已经是最新的或者它像预期的那样更新文件。在
我还有一个python脚本,在scip中是:
subprocess.call(['./update.sh'])
当它调用相同的脚本时,我得到:Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(我使用SSH)。在
----------------更新------------------
有人在找我:OK so some progress. When I boot your image I can't run git pull in
your repo directory and the bash script also fails. It seems to be
because the bitbucket repository is private and needs authentication
for pull (the one I was using was public so that's why I had no
issues). Presumably git remembers this after you type it in the first
time, bash somehow tricks git into thinking it's you typing the
command subsequently but running it from python isn't the same.
I'm not a git expert but there must be some way of setting this up so
python can provide the authentication.