-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing commands in Windows Powershell & gitBash #61
Comments
Hey @djthornton1212 👍 Thanks for the feedback 🙇 So I don't have a Windows machine, and the only windows machine I would be able to test this on is a Windows Codespace. So this one may be tricky for me 😢 This should work on Windows though? But I don't know about Powershell 🤔 I will see if I can get a Windows machine and do some investigations. The windows contributions were third party, I will see IF I can find anymore information 👍 |
So, over the weekend I thought I'd give Windows Subsystem for Linux (WSL) a try and ran into the same situation.
My WSL is running Ubuntu 20.04.4 LTS (Focal Fossa). |
Ok, so I've re-written the windows commands to use cmd:
These work all the way up to the checkout step (last above). Here it continuously dies on me with:
When I navigate to the repository folder the app creates and manually copy/paste that command in (powershell) it works as expected. I'm not sure why it's failing here or where to go next. I'm approaching my deadline to make this work. I might have to call it and start modifying these repositories by hand... yeah that's like 100+ repos. Oh on a side note. You definitely should remove the It happens again when creating the
later. That |
okay let's firstly fix this! the problem seems to be you are running on windows, can you use codespaces? There are docs for codespaces and it works from there. If you can't, can you access a Linux machine? I want to get you up and running before we try and fix the above windows commands (which obviously need solving) |
@djthornton1212 I would so test this on a Windows machine but I don't have any 😢 Have you looked at these articles: I know they are all not directly related, but they are saying the same thing 🤔 |
Hey Nick, thanks for the response. My company is relatively new to GitHub and we haven't purchased codespaces at this point in time. The first article I have seen, the second I had not. In either case the path to sysetm32 is set in PATH on my system. I've tested this in CMD, PowerShell, Git Bash and my WSL Ubuntu installation. None can make it all the way through the commands. CMD:
PowerShell:
Ubuntu WSL:
Question, I don't really see a commands section for linux. I know that the commands for macOS and ubuntu in this instance will likely be the same, but there are subtle difference like where the user's home directory is. Is this intentional? I believe my Ubuntu is failing because it's trying to make a directory in a location that doesn't exist and isn't really allowed to. |
Ok, so I went overboard and made a ...few changes. Got it working though. I'll push up my changes to my personal account so you can see what I did. Short fix though, look at this line. That should be Also, the
If you really want to use rm you'll need to either use the CMD alias arguments: |
I think we just merged in something which fixes this 👍 We also just added supported the wsl linux btw 👍 if you do a fresh pull you will get that 👍
I would love this ❤️ that would be amazing 👍 |
Hey Nick, sorry for the late response. I've posted what I've done here. Please note that I'm relatively new to JavaScript/TypeScript (2nd project I've actually touched), so it's not pretty. There was a lot of googling "what does ... do" lol. In the end the changes work for me. I was able to test with my single repo. I'm scheduling time to run against a larger pool size next. |
@djthornton1212 do not worry about this whatsoever 🙇 we have all been new so you shouldn't have to worry about not knowing!
Great to hear 🙇
Is there any chance you could make a pull request from your |
@NickLiffen I can do that. I'll merge my feature branching into main then open a PR to yours. |
Hey Nick, I wasn't sure if you saw that I created a PR for this. |
Hey @djthornton1212 I have been OOO 🙇 Today is my first day back, I am going to look at this now 👍 |
@NickLiffen Great, I could use a vacay myself. There are some conflicts from changes made after I started working on it. Let me know what you think. |
Note I'm not done with my test, it's just the end of the day for me right now and need to head out. I'll come back to this with anything more I find. Hopefully you'll do a better job at getting to the root of it than I have. Thanks!
Problem:
When attempting to run
yarn run start
after getOrgs & getRepos in PowerShell I received the following error:Error: spawn mkdir ENOENT
When attempting to run
yarn run start
after getOrgs & getRepos gitBash I received the following error:Error: spawn git ENOENT
Detailed logs below
System Info:
System OS: Windows
NodeJS: 17.5.0
Condig:
.env Config:
GITHUB_API_TOKEN=ghp_
GITHUB_ENTERPRISE=<private_company_name>
LANGUAGE_TO_CHECK=java
ENABLE_ON=secretscanning,dependabot,dependabotupdates,codescanning
CREATE_ISSUE=true
All other configs left at default
Logs:
When running in PowerShell in Windows 10
When running in git-bash in Windows 10
Expected behavior:
The GHAS tool should differentiate between CMD & PowerShell or specify one be used over the other.
I started to write out the commands here but quickly realized that's a lot to add lol. Suffice to say that though PowerShell can execute some commands from CMD, it seems to do a translation.
Example:
mkdir
- Works in either case as there are no argumentrmdir
- Doesn't translate over correctly.CMD:
rmdir /s /q <path>
- works finePowerShell:
rmdir /s /q <path>
=>Remove-Item: A positional parameter cannot be found that accepts argument '/q'.
Another I can see is
rm
. This isn't a command accepted in CMD but it is in PowerShell.Troubleshooting:
In the end it appears that
spawn
is having issues detecting the commands to run. I know it's old, but it sees to still be an issue... maybe???nodejs/node-v0.x-archive#2318
In short:
I tested this with the following:
..\ghas-enablement\serc\utils\commands.ts ->
This actually worked (in PowerShell, but not CMD). I tried several permutations prior to this with no success.
Do you see the same error in your testing?
The text was updated successfully, but these errors were encountered: