Skip to content

Commit

Permalink
fixup! fixup! Tweak the fixture test for the pre-installed-wrangler test
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed May 3, 2024
1 parent 63898d5 commit 7b0f10d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import semverEq from "semver/functions/eq";
import { exec, execShell } from "./exec";
import { checkWorkingDirectory, semverCompare } from "./utils";
import { getPackageManager } from "./packageManagers";
import { getExecOutput } from "@actions/exec";

const DEFAULT_WRANGLER_VERSION = "3.13.2";

Expand Down Expand Up @@ -88,18 +89,18 @@ async function installWrangler() {
let installedVersion = "";
try {
await exec("pwd", [], { cwd: config.workingDirectory, silent: false });
await exec(packageManager.exec, ["wrangler", "--version"], {
cwd: config["workingDirectory"],
silent: config.QUIET_MODE,
listeners: {
stdline(line) {
const versionMatch = line.match(/wrangler (\d+\.\d+\.\d+)/);
if (versionMatch) {
installedVersion = versionMatch[1];
}
},
const { stdout } = await getExecOutput(
packageManager.exec,
["wrangler", "--version"],
{
cwd: config["workingDirectory"],
silent: config.QUIET_MODE,
},
});
);
const versionMatch = stdout.match(/wrangler (\d+\.\d+\.\d+)/);
if (versionMatch) {
installedVersion = versionMatch[1];
}
if (installedVersion) {
if (config.didUserProvideWranglerVersion) {
if (semverEq(config.WRANGLER_VERSION, installedVersion)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const args = Array.from(process.argv);
const command = args.pop();
switch (command) {
case "version":
case "--version":
console.log(
"⛅️ wrangler 1.1.1 (update available 1.2.3)\n" +
"-------------------------------------------------------",
Expand Down

0 comments on commit 7b0f10d

Please sign in to comment.