Skip to content

Commit

Permalink
refactor: rename options.os to options.platform (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcastilloec authored May 12, 2021
1 parent e8d13d5 commit 7ea9e57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ Default: `undefined`

Machine architecture the package is targeted to, used to set the `--target` option.

#### options.os
#### options.platform
Type: `String`
Default: Operating system platform of the host machine
Default: Operating system platform of the host machine. For possible values see Node.js [process.platform](https://nodejs.org/api/process.html#process_process_platform)

Operating system platform the package is targeted to, used to set the `--target` option.
Operating system platform the package is targeted to, used to set the [`--target`](https://linux.die.net/man/8/rpmbuild) option.

#### options.requires
Type: `Array[String]`
Expand Down
4 changes: 2 additions & 2 deletions src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RedhatInstaller extends common.ElectronInstaller {
async createPackage () {
this.options.logger(`Creating package at ${this.stagingDir}`)

const output = await spawn('rpmbuild', ['-bb', this.specPath, '--target', `${this.options.arch}-${this.options.vendor}-${this.options.os}`, '--define', `_topdir ${this.stagingDir}`], this.options.logger)
const output = await spawn('rpmbuild', ['-bb', this.specPath, '--target', `${this.options.arch}-${this.options.vendor}-${this.options.platform}`, '--define', `_topdir ${this.stagingDir}`], this.options.logger)
this.options.logger(`rpmbuild output: ${output}`)
}

Expand Down Expand Up @@ -128,7 +128,7 @@ class RedhatInstaller extends common.ElectronInstaller {
this.normalizeVersion()

this.options.vendor = 'none'
this.options.os = this.options.os || process.platform
this.options.platform = this.options.platform || process.platform
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('module', function () {
src: 'test/fixtures/app-with-asar/',
options: {
arch: 'x86',
os: 'linux'
platform: 'linux'
}
},
'generates a `.rpm` package with linux %_target_os',
Expand Down

0 comments on commit 7ea9e57

Please sign in to comment.