ask-toolkit-for-vscode: Unable to download files on local machine

Unable to Download and edit skill on VS Code

When I open the ASK Toolkit and Create Alexa-hosted skill I can see the change in the developer console, but I am unable to get the files downloaded locally on the machine.

The error message I get is

Skill creation failed. Reason: Git folder setup failed for /Users/a/Desktop/AlexaSkills/hello123. Reason: Failed to execute git {
  "exitCode": 1,
  "gitCommand": "checkout",
  "stdout": "",
  "stderr": "error: pathspec 'prod' did not match any file(s) known to git\n"
}

I believe the error is because I am currently not in sync with the Amazon developer console.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

@SpellMender Great to hear it worked for you!

Hi @tydonelson,

Thanks for the response. It has been really helpful, and I greatly appreciate it. I had an older version of Git, but the issue has now been resolved.

Excellent! @coolbigbear’s solution worked for me! I didn’t even have to revert back to a different version of VSCode!

From start to finish, here’s the process for me to export a skill from the Amazon Developer Console to VSCode:

  1. From the Alexa Developer Console go to the “Code” tab image
  2. Select “Offline Tools” on the toolbar above the code image
  3. Select “Export to VSCode” image
  4. You will be prompted to select a folder to load your project into. You don’t have to create a new folder. A folder with the name of your project will be created for you. Then the project will fail with the error Skill clone failed. Reason: Git folder setup failed image
  5. Open a new Explorer window and navigate to C:\Users\<your_user_name>\.ask\scripts\ image
  6. Both of these files need to be edited. Double-click and open with your favorite text editor (in my case it was Notepad++) image
  7. Both of those files have a line beginning with askRefreshToken=.

askRefreshToken=$(tr -d '\n' < ${configFile} | tr -d ' ' | sed -n $configOp | sed 's/".*//')

You must add double quotes around ${ConfigFile} for both files. Be sure to save your changes.

askRefreshToken=$(tr -d '\n' < "${configFile}" | tr -d ' ' | sed -n $configOp | sed 's/".*//')

  1. Now navigate back to VSCode and make sure to open the folder with your skill (if its not already opened) in your workspace. image
  2. Open up a Terminal image
  3. Type the command git fetch and press enter. Type the command git checkout dev and press enter. image

You will now see files populate in your workspace: image

I figured if anyone on the internet is as visual a learner as I am, this should be helpful.

I’m hoping there is a quicker, easier resolution found soon.

EDIT: You should probably use git checkout master and git checkout prod as well. I used git checkout dev in the example above because that seems to be the branch that is associated with the code you actually edit in the Alexa Developer Console.