Skip to content
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

Also search %PATH% for sqlpackage.exe #814

Merged

Conversation

colind-work
Copy link
Contributor

The installation documentation for SqlPackage says: Installing SqlPackage as a global tool makes it available on your path as sqlpackage and is the recommended method to install SqlPackage for Windows, macOS, and Linux.

In line with Microsoft's expectations, also search %PATH% if sqlpackage is not found in the d365fo.tools default path ($Script:SqlPackagePath). If it is found in the %PATH% then update the default path with the actual path to sqlpackage.exe.

Author: Colin Daley
Date: 2024-03-24

The installation documentation for SqlPackage says:
Installing SqlPackage as a global tool makes it available on your path
as sqlpackage and is the recommended method to install SqlPackage for
Windows, macOS, and Linux.

In line with Microsoft's expectations, also search %PATH% if
sqlpackage is not found in the d365fo.tools default path
($Script:SqlPackagePath). If it is found in the %PATH% then update the
default path with the actual path to sqlpackage.exe.

Author: Colin Daley
Date: 2024-03-24
@colind-work
Copy link
Contributor Author

The failure is
Describe : Verifying integrity of module files
Context : Validating PS1 Script files
Name : It [internal\functions\invoke-sqlpackage.ps1] Should have no trailing space
Result : Failed
Message : Expected $null or empty, but got @(140, 143).

The failure was detected by this line:
at , D:\a\1\s\d365fo.tools\tests\general\FileIntegrity.Tests.ps1: line 45
45: ($file | Select-String "\s$" | Where-Object { $_.Line.Trim().Length -gt 0}).LineNumber | Should -BeNullOrEmpty

However, I do not see any trailing spaces in invoke-sqlpackage.ps1. It has a blank line at the top, but other scripts in the same folder have a blank line at the top.

@FH-Inway
Copy link
Member

Thanks for the contribution. Let me take a look at the checks.

You can also try to run the d365fo.tools-Generate-Text action in your fork against the invoke_sqlpackage_fix branch. If it finds any issues that can be fixed by the action, it will create a new pull request in your fork. When that pr gets merged to the invoke_sqlpackage_fix branch, it should kick off another run of the checks.

@FH-Inway
Copy link
Member

FH-Inway commented Mar 25, 2024

The message you found in the check log actually lists the line numbers with trailing whitespace. I added comments with a fix suggestion to each line.

Not sure why those trailing whitespaces did not appear for you.

Message : Expected $null or empty, but got @(140, 143).

@Splaxi Do you see any obstacles adding a script that cleans up trailing whitespace?

@colind-work
Copy link
Contributor Author

My mistake. I was looking for blank lines at the end of the file. I will remove them when I get home from work.

@FH-Inway FH-Inway merged commit d137d94 into d365collaborative:development Mar 25, 2024
11 checks passed
@colind-work
Copy link
Contributor Author

The message should have been "Remove trailing spaces from previous commit".

@FH-Inway
Copy link
Member

Well, "leading" isn't wrong in this case, though a bit of unusual terminology 😄

Thanks again for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants