Skip to content

Commit

Permalink
fix: Use nix paths for updater script
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbot95 committed Mar 3, 2024
1 parent 2246f14 commit 90696a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion apps/updater/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { parseArgs } from 'https://deno.land/[email protected]/cli/parse_args.ts';
import * as path from "https://deno.land/[email protected]/path/mod.ts";
import { LockFile, SteamObject, parseObject } from './parser.ts'

const __filename = path.fromFileUrl(import.meta.url);
// Without trailing slash
const __dirname = path.dirname(path.fromFileUrl(import.meta.url));

const utf8Decoder = new TextDecoder();

/**
Expand Down Expand Up @@ -94,6 +99,7 @@ async function updateLockFile(
const main = async () => {
const args = parseArgs(Deno.args, {
alias: {
"a": "add-to-store",
"d": "dry-run"
},
boolean: ["add-to-store", "dry-run", "help"],
Expand Down Expand Up @@ -131,7 +137,7 @@ async function prefetch(
branch: string,
addToStore: boolean,
): Promise<string> {
const command = new Deno.Command("./apps/updater/prefetch.sh", {
const command = new Deno.Command(`${__dirname}/prefetch.sh`, {
env: {
appId, depotId, manifestId, branch,
name: `${name}-depot`,
Expand Down
2 changes: 1 addition & 1 deletion apps/updater/prefetch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Mostly copied from https://github.com/nix-community/steam-fetcher/blob/2033f99c7aee506f5af18026a3cab1c93bd0439f/fetch-steam/builder.sh

Expand Down

0 comments on commit 90696a2

Please sign in to comment.