Skip to content

Commit 1b51387

Browse files
committed
Remove CliOptions interface from AlbumOptions
1 parent a5a5a00 commit 1b51387

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: src/cli/album-options.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
import { existsSync } from 'fs'
22
import { readFile, writeFile } from 'fs/promises'
33
import { resolve } from 'path'
4-
import { CliOptions } from './options'
54

6-
export interface AlbumOptions extends Partial<CliOptions> {
5+
export interface AlbumOptions {
76
defaultAlbumHint?: string
87
}
98

109
const AlbumOptionsFileName = 'thtag.json'
1110
export const getAlbumOptions = async (
1211
workingDir: string,
13-
baseOptions: Partial<CliOptions> = {},
12+
fallback: Partial<AlbumOptions> = {},
1413
): Promise<AlbumOptions> => {
1514
const albumOptionsPath = resolve(workingDir, AlbumOptionsFileName)
1615
if (!existsSync(albumOptionsPath)) {
17-
return baseOptions
16+
return fallback
1817
}
1918
try {
2019
const albumOptions = JSON.parse(
2120
await readFile(albumOptionsPath, { encoding: 'utf-8' }),
2221
) as AlbumOptions
2322
return {
24-
...baseOptions,
23+
...fallback,
2524
...albumOptions,
2625
}
2726
} catch (error) {
28-
return baseOptions
27+
return fallback
2928
}
3029
}
3130
export const setAlbumOptions = async (workingDir: string, options: Partial<AlbumOptions>) => {

0 commit comments

Comments
 (0)