Skip to content

Testing locally on Windows #42

@chrisglein

Description

@chrisglein

I'd be helpful if I could do testing of this locally on my Windows box. There are different expectations in environment expectations, and you may not agree with how Windows is set up, but the situation remains. For other projects generally I'm able to get running anyway. For example when doing GitHub Pages local with Jekyll, I have to manually drop into a bash prompt, but then everything is good from there. There's might be something more compatible here by delving deeper into WSL, but I haven't needed that previously.

But here's the experience I get:

❯ npm run build

> build
> ./songs-to-json && pug-pack src

'.' is not recognized as an internal or external command,
operable program or batch file.

(same result running from either standard Windows terminal or a bash prompt)

From the gate it doesn't want to run the python script. Python doesn't come in the box, but can be installed from the command-line with winget:

winget install -e --id Python.Python.3.11

After that, it's available in the path:

❯ python -V
Python 3.11.9

There's no file extension for songs-to-json. Is running it with python intended to be inferred from the file contents?

I can run it manually and it does the thing:

❯ python .\songs-to-json
weird song: toss.pdf

(which is to say it exports src/songs.json and src/by-title.json)

Next step in the script is to run pug-pack on that src folder. And pug-pack exists:

❯ npx pug-pack -h
usage:

pug-pack [src] [dist] [-p|--prod|--production] [-w|--watch]
  [-v|--verbose] [-c|--clean]

pug-pack [-l|--list] [-i|--init] [-h|--help] [-V|--version]

default: pug-pack ./src ./dist

But trying to run that manually doesn't work:

❯ npx pug-pack src
OperationalError: Command failed: find 'C:\Users\chris\source\repos\shanties\node_modules\pug-pack\src' -type f -print0
FIND: Parameter format not correct

    at ChildProcess.exithandler (node:child_process:422:12)
    ... 3 lines matching cause stack trace ...
 {
  cause: Error: Command failed: find 'C:\Users\chris\source\repos\shanties\node_modules\pug-pack\src' -type f -print0
  FIND: Parameter format not correct

      at ChildProcess.exithandler (node:child_process:422:12)
      at ChildProcess.emit (node:events:515:28)
      at maybeClose (node:internal/child_process:1105:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
   {
    code: 2,
    killed: false,
    signal: null,
    cmd: "find 'C:\\Users\\chris\\source\\repos\\shanties\\node_modules\\pug-pack\\src' -type f -print0"
  },
  isOperational: true,
  code: 2,
  killed: false,
  signal: null,
  cmd: "find 'C:\\Users\\chris\\source\\repos\\shanties\\node_modules\\pug-pack\\src' -type f -print0"
}

Which smells like a relative path / working directory issue, but I haven't found a variant that comes up with anything different.

This is as far as I've had it get.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions