Skip to content

Commit 6dbd5a4

Browse files
Fixed a bug in dependency manager file handling
1 parent 275ea5d commit 6dbd5a4

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const previewUpdater = async () => {
5454
config.package ||= defaultPackage;
5555
config.data ||= <Data>{};
5656

57-
config.package.name ||= packageLock.name;
57+
config.package.name ||= packageLock.name || config.repository?.repo;
5858
config.data.title ||= titleCase(config.repository?.repo);
5959
config.data.description ||=
6060
packageLock.description || config.repository?.owner;

src/types/lockFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export interface LockFile {
2-
name: string;
3-
description: string;
2+
name?: string;
3+
description?: string;
44

55
dependencies?: Record<string, string>[];
66
require?: Record<string, string>[];

src/utils/packageManagers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ export const getPackageManager = (config: Config): LockFile => {
2222
return getComposer(config);
2323
}
2424

25-
return getNpm(config);
25+
if (hasNpm(config) || hasYarn(config)) {
26+
return getNpm(config);
27+
}
28+
29+
return <LockFile>{};
2630
};

0 commit comments

Comments
 (0)