u2a 3.4.19 → 3.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/appGenerator.js +1 -1
- package/src/utils/builder.js +2 -1
- package/src/utils/logger.js +1 -1
- package/src/utils/noroot.js +7 -3
package/package.json
CHANGED
|
@@ -254,7 +254,7 @@ app.on('activate', () => {
|
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
`;
|
|
257
|
-
}
|
|
257
|
+
} // note for one day: put this in a different file
|
|
258
258
|
|
|
259
259
|
async function createPackageJson(appName, iconPath, isExecutable = false, createSetup = false) {
|
|
260
260
|
const u2aPackagePath = path.resolve(__dirname, '../../package.json');
|
package/src/utils/builder.js
CHANGED
|
@@ -114,7 +114,8 @@ async function buildSetup(appDir, platform, arch) {
|
|
|
114
114
|
return null;
|
|
115
115
|
}
|
|
116
116
|
} catch (error) {
|
|
117
|
-
logger.error(`Error while building setup
|
|
117
|
+
logger.error(`Error while building setup.`, error);
|
|
118
|
+
logger.warn('Try to run u2a with administrator privileges to avoid this error.');
|
|
118
119
|
return null;
|
|
119
120
|
}
|
|
120
121
|
}
|
package/src/utils/logger.js
CHANGED
package/src/utils/noroot.js
CHANGED
|
@@ -6,7 +6,7 @@ const logger = new Logger('noroot');
|
|
|
6
6
|
|
|
7
7
|
async function checkNotRoot(allowRoot = false) {
|
|
8
8
|
if (allowRoot) {
|
|
9
|
-
logger.warn('Running with elevated privileges. This is not recommended.'
|
|
9
|
+
logger.warn('Running with elevated privileges. This is not recommended.');
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -15,7 +15,9 @@ async function checkNotRoot(allowRoot = false) {
|
|
|
15
15
|
switch (platform) {
|
|
16
16
|
case 'win32':
|
|
17
17
|
if (await isAdmin()) {
|
|
18
|
-
logger.error('This application should not be run as an administrator.'
|
|
18
|
+
logger.error('This application should not be run as an administrator.');
|
|
19
|
+
logger.warn('Run with --allowroot to avoid this message.');
|
|
20
|
+
logger.warn('Running u2a as administrator can be dangerous.');
|
|
19
21
|
process.exit(1);
|
|
20
22
|
}
|
|
21
23
|
break;
|
|
@@ -23,7 +25,9 @@ async function checkNotRoot(allowRoot = false) {
|
|
|
23
25
|
case 'darwin':
|
|
24
26
|
case 'linux':
|
|
25
27
|
if (process.getuid() === 0) {
|
|
26
|
-
logger.error('This application should not be run as root.'
|
|
28
|
+
logger.error('This application should not be run as root.');
|
|
29
|
+
logger.warn('Run with --allowroot to avoid this message.');
|
|
30
|
+
logger.warn('Running u2a as root can be dangerous.');
|
|
27
31
|
process.exit(1);
|
|
28
32
|
}
|
|
29
33
|
break;
|