Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(Builder): fix executing permission for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
evshiron committed May 10, 2017
1 parent 98cb1e4 commit 1841dba
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/lib/Builder.ts
Expand Up @@ -2,7 +2,7 @@
import { dirname, basename, resolve } from 'path';

import * as semver from 'semver';
import { ensureDir, emptyDir, readFile, readJson, writeFile, copy, remove, createReadStream, createWriteStream, rename } from 'fs-extra';
import { ensureDir, emptyDir, readFile, readJson, writeFile, copy, remove, rename, chmod, createReadStream, createWriteStream } from 'fs-extra';
import * as Bluebird from 'bluebird';

const debug = require('debug')('build:builder');
Expand Down Expand Up @@ -316,10 +316,18 @@ export class Builder {

protected renameMacApp(targetDir: string, appRoot: string, pkg: any, config: BuildConfig) {

const src = resolve(targetDir, 'nwjs.app');
const dest = resolve(targetDir, `${ config.mac.displayName }.app`);
const src = resolve(targetDir, 'nwjs.app');
const dest = resolve(targetDir, `${ config.mac.displayName }.app`);

return rename(src, dest);
return rename(src, dest);

}

protected async fixLinuxMode(targetDir: string, appRoot: string, pkg: any, config: BuildConfig) {

const path = resolve(targetDir, 'nw');

await chmod(path, 0o744);

}

Expand Down Expand Up @@ -348,6 +356,8 @@ export class Builder {

protected async prepareLinuxBuild(targetDir: string, appRoot: string, pkg: any, config: BuildConfig) {

await this.fixLinuxMode(targetDir, appRoot, pkg, config);

}

protected async copyFiles(platform: string, targetDir: string, appRoot: string, pkg: any, config: BuildConfig) {
Expand Down

0 comments on commit 1841dba

Please sign in to comment.