Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaque committed Nov 7, 2024
1 parent d830e86 commit 9b0adb7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/checkVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boxen from "boxen";
import chalk from "chalk";
import { version } from "../package.json";
import pkg from "../package.json" with { type: "json" };
import semver from "semver";

async function checkProductionCLIVersion() {
Expand All @@ -21,6 +21,7 @@ async function checkProductionCLIVersion() {
}

export async function checkVersion() {
const version = pkg.version;
const latestVersion = await checkProductionCLIVersion();
if (latestVersion && version !== latestVersion) {
const isOutdated = semver.lt(version, latestVersion);
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bun

import { Command } from "commander";
import { version } from "../package.json" with { type: "json" };
import pkg from "../package.json" with { type: "json" };
import { registerBalance } from "./lib/balance.ts";
import { registerBuy } from "./lib/buy/index.tsx";
import { registerContracts } from "./lib/contracts/index.tsx";
Expand All @@ -23,7 +23,7 @@ await checkVersion();
program
.name("sf")
.description("The San Francisco Compute command line tool.")
.version(version);
.version(pkg.version);

// commands
registerLogin(program);
Expand All @@ -42,4 +42,4 @@ registerDown(program);
// (development commands)
registerDev(program);

program.parse(Bun.argv);
program.parse(process.argv);
1 change: 1 addition & 0 deletions src/lib/buy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import TextInput from "ink-text-input";
import { useCallback, useEffect, useState } from "react";
import { Text } from "ink";
import ConfirmInput from "../ConfirmInput.tsx";
import React from 'react'

dayjs.extend(relativeTime);
dayjs.extend(duration);
Expand Down
8 changes: 4 additions & 4 deletions src/lib/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { confirm } from "@inquirer/prompts";
import chalk from "chalk";
import type { Command } from "commander";
import dayjs from "npm:[email protected]";
import utc from "npm:[email protected]/plugin/utc";
import utc from "npm:[email protected]/plugin/utc.js";
import {
deleteConfig,
getConfigPath,
Expand Down Expand Up @@ -120,9 +120,9 @@ function registerEpoch(program: Command) {
timestamps.forEach((epochTimestamp, i) => {
const date = epochToDate(Number.parseInt(epochTimestamp));
console.log(
`${colorDiffedEpochs[i]} | ${
chalk.yellow(dayjs(date).format("hh:mm A MM-DD-YYYY"))
} Local`,
`${colorDiffedEpochs[i]} | ${chalk.yellow(
dayjs(date).format("hh:mm A MM-DD-YYYY"),
)} Local`,
);
});
}
Expand Down

0 comments on commit 9b0adb7

Please sign in to comment.