Skip to content

Commit

Permalink
See if we can get bleep working on powershell.
Browse files Browse the repository at this point in the history
Found some instructions in dirs-dev/directories-jvm#49 (comment)
  • Loading branch information
oyvindberg committed Feb 12, 2023
1 parent 7dd7427 commit 50f0f5c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@ jobs:
if: runner.os == 'Windows'

- name: Test binary after build 1 (windows)
shell: cmd
env:
CI: true
# todo: fix tests on windows
run: .\${{ matrix.file_name }} --dev compile --no-color jvm213
if: runner.os == 'Windows'

- name: Test binary after build 2 (windows)
shell: cmd
env:
CI: true
# todo: fix tests on windows
Expand Down
20 changes: 18 additions & 2 deletions bleep-core/src/scala/bleep/UserPaths.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package bleep

import coursier.cache.shaded.dirs.ProjectDirectories
import coursier.cache.shaded.dirs.{GetWinDirs, ProjectDirectories}

import java.nio.file.Path

Expand All @@ -13,7 +13,23 @@ case class UserPaths(cacheDir: Path, configDir: Path) {

object UserPaths {
def fromAppDirs: UserPaths = {
val dirs = ProjectDirectories.from("build", null, "bleep")
val getWinDirs: GetWinDirs =
if (coursier.paths.Util.useJni) {
new GetWinDirs {
override def getWinDirs(guids: String*): Array[String] = {
val dirs = new Array[String](guids.length)
var i = 0
while (i < guids.length) {
dirs(i) = coursier.jniutils.WindowsKnownFolders.knownFolderPath("{" + guids(i) + "}")

i += 1
}
dirs
}
}
} else GetWinDirs.powerShellBased

val dirs = ProjectDirectories.from("build", null.asInstanceOf[String], "bleep", getWinDirs)
val cacheDir = Path.of(dirs.cacheDir)
val configDir = Path.of(dirs.configDir)

Expand Down

0 comments on commit 50f0f5c

Please sign in to comment.