Git Product home page Git Product logo

Comments (3)

jkent avatar jkent commented on July 21, 2024

Hopefully one of these days I'll get around to testing this on a Windows host machine. Have you made any more progress since your initial report?

from frogfs.

xobs avatar xobs commented on July 21, 2024

I have discovered a workaround to this. I have a patch I've made to get mkespfsimage.py working.

I was getting ready to make a PR, but then I discovered that it no longer exists. I believe a similar patch would be:

diff --git a/tools/preprocess.py b/tools/preprocess.py
index 8358e0d..9dfb3ef 100755
--- a/tools/preprocess.py
+++ b/tools/preprocess.py
@@ -251,6 +251,10 @@ def preprocess(path, preprocessors):
             command = config['preprocessors'][preprocessor]['command']
             if command[0].startswith('tools/'):
                 command[0] = os.path.join(script_dir, command[0][6:])
+            # These are implemented as `.cmd` files on Windows, which explicitly
+            # requires them to be run under `cmd /c`
+            if os.name == 'nt':
+                command = ["cmd", "/c"] + command
             process = subprocess.Popen(command, stdin=subprocess.PIPE,
                     stdout=subprocess.PIPE, shell=True)
             data = process.communicate(input=data)[0]

I'm working around #33 to try and test it. With this patch applied I have successfully generated an output directory.

The issue appears to be that npm stores its scripts in .cmd files that are roughly equivalent to .sh files on Posix systems. However, since Windows has no concept of a shebang it doesn't actually know to run it. The trick is to run it under a shell, similar to how you might run bash -c. I'm not sure why shell=True doesn't actually accomplish this, but prefixing the command with cmd /c does the trick.

from frogfs.

jkent avatar jkent commented on July 21, 2024

I will no longer using npx in favor of calling stub scripts with node directly for running the various tools. In the mean time, this has been merged.

from frogfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.