Skip to content

[Bug] --inject not work on macos #914

Open
@morganorix

Description

@morganorix

Search before asking

  • 我在 issues 列表中搜索,没有找到类似的内容。
    I searched in the issues and found nothing similar.

Pake version

Version of pake cli : 3.1.1

System version

Version of system : MacOs 15.2

Node.js version

Node.js v20.18.2

Minimal reproduce step

pake "https://chat.mistral.ai/chat" --name "MistralAI" --hide-title-bar --icon ./icon_512.icns --debug true --inject ./inject.js 
PakeAppOptions {
  icon: '/Users/morganorix/Documents/apps maison/mistralai/icon_512.icns',
  width: 1200,
  height: 780,
  useLocalFile: false,
  fullscreen: false,
  hideTitleBar: true,
  multiArch: false,
  inject: './inject.js',
  debug: true,
  proxyUrl: '',
  userAgent: '',
  targets: 'deb',
  appVersion: '1.0.0',
  alwaysOnTop: false,
  darkMode: false,
  disabledWebShortcuts: false,
  activationShortcut: '',
  showSystemTray: false,
  systemTrayIcon: '',
  installerLanguage: 'en-US',
  name: 'MistralAI',
  identifier: 'com.pake.d5f4c2'
}
www.npmjs.com latency is 29 ms
✹ Installing package...

up to date, audited 211 packages in 1s

69 packages are looking for funding
  run `npm fund` for details

✔ Package installed!
✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.
file:///Users/morganorix/Pake/dist/cli.js:572
        if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
                    ^

TypeError: inject.every is not a function
    at mergeConfig (file:///Users/morganorix/Pake/dist/cli.js:572:21)
    at async MacBuilder.buildAndCopy (file:///Users/morganorix/Pake/dist/cli.js:656:9)
    at async MacBuilder.build (file:///Users/morganorix/Pake/dist/cli.js:649:9)
    at async Command.<anonymous> (file:///Users/morganorix/Pake/dist/cli.js:1013:5)
`


### What did you expect to see?

I expect the --inject option to work

### What did you see instead?

`pake "https://chat.mistral.ai/chat" --name "MistralAI" --hide-title-bar --icon ./icon_512.icns --debug true --inject ./inject.js 
PakeAppOptions {
  icon: '/Users/morganorix/Documents/apps maison/mistralai/icon_512.icns',
  width: 1200,
  height: 780,
  useLocalFile: false,
  fullscreen: false,
  hideTitleBar: true,
  multiArch: false,
  inject: './inject.js',
  debug: true,
  proxyUrl: '',
  userAgent: '',
  targets: 'deb',
  appVersion: '1.0.0',
  alwaysOnTop: false,
  darkMode: false,
  disabledWebShortcuts: false,
  activationShortcut: '',
  showSystemTray: false,
  systemTrayIcon: '',
  installerLanguage: 'en-US',
  name: 'MistralAI',
  identifier: 'com.pake.d5f4c2'
}
www.npmjs.com latency is 29 ms
✹ Installing package...

up to date, audited 211 packages in 1s

69 packages are looking for funding
  run `npm fund` for details

✔ Package installed!
✼ The first packaging may be slow, please be patient and wait, it will be faster afterwards.
file:///Users/morganorix/Pake/dist/cli.js:572
        if (!inject.every(item => item.endsWith('.css') || item.endsWith('.js'))) {
                    ^

TypeError: inject.every is not a function
    at mergeConfig (file:///Users/morganorix/Pake/dist/cli.js:572:21)
    at async MacBuilder.buildAndCopy (file:///Users/morganorix/Pake/dist/cli.js:656:9)
    at async MacBuilder.build (file:///Users/morganorix/Pake/dist/cli.js:649:9)
    at async Command.<anonymous> (file:///Users/morganorix/Pake/dist/cli.js:1013:5)

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions