Skip to content

Commit 23e7950

Browse files
authored
Merge pull request #1476 from Duet3D/hotfix-filechecks
Updating read file
2 parents 725ec95 + 750db1a commit 23e7950

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

nodescriptsTS/src/functions_platform_stats.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,17 @@ const getPluginPlatformVersionList = async (gituser, gitrepo, parent_folder = 'p
9393
let file_path = `${parent_folder}/${gitrepo}.json`;
9494
console.log("getPluginPlatformVersionList for", gituser, gitrepo, file_path, is_new_plugin)
9595

96-
const current_file = is_new_plugin ? [] : await readFile.JSON(file_path) || [];
97-
96+
let current_file_temp = [];
97+
try{
98+
current_file_temp = is_new_plugin ? [] : await readFile.JSON(file_path) || [];
99+
}
100+
catch(e){
101+
console.log(e);
102+
current_file_temp = []
103+
}
104+
105+
const current_file = current_file_temp;
106+
98107
const latest_tagName = ((current_file || [])[0] || {})['tagName'];
99108
const releases = await getReleases(gituser, gitrepo, latest_tagName) || [];
100109
console.log(gitrepo, ': New Releases');

0 commit comments

Comments
 (0)