Skip to content

Commit 43d5a0b

Browse files
committed
correct default url
1 parent ff74117 commit 43d5a0b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/cli/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export default function parseCliOptions(): CliOptions {
156156
if (args['--path']) paths.push(...args['--path'])
157157

158158
return {
159-
apiUrl: args['--api-url'] ?? config?.apiUrl ?? defaultApiUrl,
159+
apiUrl: args['--api-url'] ?? config?.apiUrl,
160160
webToken: args['--web-token'],
161161
webDir,
162162
curseforgeToken: args['--curseforge-token'],

src/web.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios, { AxiosInstance } from 'axios'
2+
import chalk from 'chalk'
23
import FormData from 'form-data'
34
import { createReadStream, existsSync, readdirSync, readFileSync } from 'fs'
45
import fs from 'fs-extra'
@@ -14,19 +15,21 @@ export interface WebOptions {
1415
}
1516

1617
export const defaultWebDir = 'web'
17-
export const defaultApiUrl = 'https://pack.macarena.ceo/api'
18+
export const defaultApiUrl = 'https://packs.macarena.ceo/api'
1819

1920
export default class WebService {
2021
private readonly api: AxiosInstance
2122
private readonly dir: string
23+
private readonly baseUrl: string
2224

23-
constructor(private readonly options: Readonly<WebOptions>) {
25+
constructor(options: Readonly<WebOptions>) {
2426
if (!options.webToken) throw new Error('Web Token missing')
2527

2628
this.dir = options.webDir ?? defaultWebDir
29+
this.baseUrl = options.apiUrl ?? defaultApiUrl
2730

2831
this.api = axios.create({
29-
baseURL: options.apiUrl ?? defaultApiUrl,
32+
baseURL: this.baseUrl,
3033
headers: {
3134
'Content-Type': 'application/json',
3235
Authorization: `Bearer ${options.webToken}`,
@@ -40,7 +43,7 @@ export default class WebService {
4043
}
4144

4245
async updateWeb() {
43-
console.group('Updating web')
46+
console.group(`Updating web at ${chalk.underline(this.baseUrl)}`)
4447

4548
await Promise.all([...this.updatePages(), this.updateData(), this.updateAssets()])
4649

0 commit comments

Comments
 (0)