1
爲了更好的理解而重寫。BASH中的變量賦值
我正在自定義一個基於git flow的插件,我試圖讓init的尾部創建一個倉庫。我知道所有的命令手動做,但因爲這個原因,我不能自動化它。
REPO_NAME= `${PWD##*/}`
echo $REPO_NAME
ORG=':org_name'
curl -u 'user:pass' \
-d '{ "name": "'$REPO_NAME'", "private": "true", "has_issues": "true", "has_wiki": "false", "has_downloads": "true"}' -i "https://api.github.com/orgs/$ORG/repos"
不管我對命令做什麼,我總是得到這個,並且捲曲失敗。
/usr/local/bin/git-hf: 1: /usr/local/bin/git-hf: test-testy: not found
errors": [
{
"code": "custom",
"field": "name",
"resource": "Repository",
"message": "name is too short (minimum is 1 characters)"
}
], 「消息」:「驗證失敗」
我知道這可能是一個愚蠢的問題,但我更關心的是在我的邏輯錯誤在這裏,而不是立即解決。
改變的問題,以更好地反映我做什麼。我希望有所幫助。正如我上面所說,我想要分配該變量的方式存在一些問題,而不是我想要發送的特定修復程序。 –