Skip to content

Commit 9ea8769

Browse files
revamping archive editor for WDT 3.0 changes (#204)
1 parent 5adcd07 commit 9ea8769

21 files changed

+1212
-486
lines changed

electron/app/js/fsUtils.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
const { constants } = require('fs');
@@ -35,6 +35,26 @@ async function isDirectory(filePath) {
3535
});
3636
}
3737

38+
async function isFile(filePath) {
39+
return new Promise((resolve, reject) => {
40+
fsPromises.lstat(filePath)
41+
.then(stats => {
42+
if (stats) {
43+
resolve(stats.isFile());
44+
} else {
45+
resolve(false);
46+
}
47+
})
48+
.catch(err => {
49+
if (err.code === 'ENOENT') {
50+
resolve(false);
51+
} else {
52+
reject(err);
53+
}
54+
});
55+
});
56+
}
57+
3858
async function exists(filePath) {
3959
return new Promise((resolve, reject) => {
4060
fsPromises.lstat(filePath)
@@ -358,6 +378,7 @@ module.exports = {
358378
getFilesRecursivelyFromDirectory,
359379
getRelativePath,
360380
isDirectory,
381+
isFile,
361382
isRootDirectory,
362383
isValidFileName,
363384
makeDirectoryIfNotExists,

electron/app/js/ipcRendererPreload.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
const { contextBridge, ipcRenderer } = require('electron');
@@ -128,10 +128,11 @@ contextBridge.exposeInMainWorld(
128128
'get-latest-wko-version-number',
129129
'get-wko-release-versions',
130130
'get-archive-entry-types',
131-
'get-archive-entry',
131+
'wrc-get-archive-entry',
132132
'get-network-settings',
133133
'choose-archive-file',
134-
'choose-archive-entry',
134+
'choose-archive-entry-file',
135+
'add-archive-entry',
135136
'choose-domain-home',
136137
'choose-java-home',
137138
'choose-model-file',

0 commit comments

Comments
 (0)