1

Reworded for better understanding.

I am customizing a git flow based plugin and I am trying to get the tail end of init to create a repo. I know all the commands to do it manually but for so reason I can't automate it.

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"

And no matter what I do to the command I always get this and curl fail.

/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)"
}

], "message": "Validation Failed"

I know this is probably a stupid question but I am more concerned with the error in my logic here rather than the immediate solution.

1
  • Altered the question to better reflect what I am up to. I hope that helps. As I said above there is some issue with the way I want to assign that variable rather than the specific fix that I want to route out. Commented Jan 22, 2013 at 20:29

1 Answer 1

1

Just try doing this :

dir=${PWD##*/}
echo "$dir"
Sign up to request clarification or add additional context in comments.

1 Comment

sigh. So it was just the spacing. Thank You So Much. I really hate wasting peoples time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.