Skip to content

Commit f40ac60

Browse files
committed
use sudo instead of fakeroot if available
fakeroot is slower than sudo
1 parent 9f91544 commit f40ac60

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

script/lib/create-debian-package.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,13 @@ module.exports = function(packagedAppPath) {
208208
compressionLevel = 6;
209209
compressionType = 'xz';
210210
}
211+
// use sudo if available to speed up build
212+
let sudoCommand = 'fakeroot';
213+
if (process.env.CI === true || (process.getuid && process.getuid() === 0)) {
214+
sudoCommand = 'sudo';
215+
}
211216
spawnSync(
212-
'fakeroot',
217+
sudoCommand,
213218
[
214219
'dpkg-deb',
215220
`-Z${compressionType}`,

0 commit comments

Comments
 (0)