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

On Unix like OSs, look for sqlpackage in directories specified in $PATH #2700

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/app/Fake.Sql.SqlPackage/Sql.SqlPackage.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ module SqlPackage =

let internal validPaths =
let paths = [
let macOrLinux = Set [ PlatformID.MacOSX; PlatformID.Unix ]
if macOrLinux.Contains Environment.OSVersion.Platform then
!!"/usr/local/bin/sqlpackage"
|> Seq.map (fun path -> path, 15)
if Environment.isUnix then
Seq.append Environment.pathDirectories ["/usr/local/bin"; "/usr/bin"] |> Seq.map (fun dir -> !!(dir </> "sqlpackage")) |> Seq.concat |> Seq.map (fun path -> path, 15)
else
let getSqlVersion (path:string) = path.Split '\\' |> Array.item 3 |> int
let getVsVersion (path: string) = (Path.GetDirectoryName path |> DirectoryInfo).Name |> int
Expand Down Expand Up @@ -210,4 +208,3 @@ module SqlPackage =
data)
|> Proc.run
|> ignore