pear-build 0.0.0 → 0.0.2

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.
Files changed (2) hide show
  1. package/index.js +8 -10
  2. package/package.json +1 -6
package/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  const path = require('path')
3
- const os = require('os')
4
3
  const fs = require('fs')
5
4
  const Localdrive = require('localdrive')
6
5
  const { command, flag, bail } = require('paparam')
@@ -15,24 +14,23 @@ const program = command(
15
14
  flag('--win32-x64-app [path]', 'Path to Windows x64 app'),
16
15
  flag('--target [path]', 'Target build dir'),
17
16
  async function (cmd) {
18
- const cwd = os.cwd ? os.cwd() : process.cwd()
19
- const package = path.join(cwd, cmd.flags.package)
17
+ const package = path.resolve(cmd.flags.package)
20
18
  const pkg = require(package)
21
- const { target = path.join(cwd, pkg.name + '-' + pkg.version) } = cmd.flags
19
+ const { target = path.resolve(pkg.name + '-' + pkg.version) } = cmd.flags
22
20
  const darwinArm64App = cmd.flags.darwinArm64App
23
- ? ['darwin-arm64', path.join(cwd, cmd.flags.darwinArm64App)]
21
+ ? ['darwin-arm64', path.resolve(cmd.flags.darwinArm64App)]
24
22
  : null
25
23
  const darwinX64App = cmd.flags.darwinX64App
26
- ? ['darwin-x64', path.join(cwd, cmd.flags.darwinX64App)]
24
+ ? ['darwin-x64', path.resolve(cmd.flags.darwinX64App)]
27
25
  : null
28
26
  const linuxArm64App = cmd.flags.linuxArm64App
29
- ? ['linux-arm64', path.join(cwd, cmd.flags.linuxArm64App)]
27
+ ? ['linux-arm64', path.resolve(cmd.flags.linuxArm64App)]
30
28
  : null
31
29
  const linuxX64App = cmd.flags.linuxX64App
32
- ? ['linux-x64', path.join(cwd, cmd.flags.linuxX64App)]
30
+ ? ['linux-x64', path.resolve(cmd.flags.linuxX64App)]
33
31
  : null
34
32
  const win32X64App = cmd.flags.win32X64App
35
- ? ['window-x64', path.join(cwd, cmd.flags.win32X64App)]
33
+ ? ['window-x64', path.resolve(cmd.flags.win32X64App)]
36
34
  : null
37
35
 
38
36
  const byArch = path.join(target, 'by-arch')
@@ -47,7 +45,7 @@ const program = command(
47
45
  const noop = () => {}
48
46
  const promises = []
49
47
  for (const [arch, app] of apps) {
50
- const archApp = path.join(byArch, arch, 'app')
48
+ const archApp = path.join(byArch, arch, 'app', path.basename(app))
51
49
  await fs.promises.mkdir(archApp, { recursive: true })
52
50
  const src = new Localdrive(app)
53
51
  const dst = new Localdrive(archApp)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pear-build",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "main": "index.js",
5
5
  "type": "commonjs",
6
6
  "bin": "index.js",
@@ -13,10 +13,6 @@
13
13
  "bare": "bare-path",
14
14
  "default": "path"
15
15
  },
16
- "os": {
17
- "bare": "bare-os",
18
- "default": "os"
19
- },
20
16
  "fs": {
21
17
  "bare": "bare-fs",
22
18
  "default": "fs"
@@ -29,7 +25,6 @@
29
25
  "dependencies": {
30
26
  "bare-build": "^0.4.1",
31
27
  "bare-fs": "^4.5.3",
32
- "bare-os": "^3.6.2",
33
28
  "bare-path": "^3.0.0",
34
29
  "hypercore-id-encoding": "^1.3.0",
35
30
  "localdrive": "^2.2.0",