Skip to content

Commit

Permalink
refactor: read steam path from gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Oct 1, 2024
1 parent e916eae commit 0be4e9c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion paths.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { resolve } from "@std/path"

const readGradle = async (): Promise<Record<string, string>> => {
const gradle = await Deno.readTextFile("gradle.properties")

return Object.fromEntries(gradle.split("\n").map((line) => line.trim().split("=")))
}

const gradleProperties = await readGradle()

export const root = import.meta.dirname!
export const jar = resolve(root, "build", "libs", "MarisaContinued.jar")
export const image = resolve("docs", "thumbnail", "image.jpg")

export const home = Deno.env.get("HOME")!
export const steam = resolve(home, ".steam", "steam", "steamapps", "common")
export const steam = resolve(gradleProperties["userSteamDir"], "common")
export const mod = resolve(steam, "SlayTheSpire", "MarisaContinued")

0 comments on commit 0be4e9c

Please sign in to comment.