Giter VIP home page Giter VIP logo

Comments (4)

SimonIT avatar SimonIT commented on July 30, 2024

If I understand you correctly .\folder\script.cmd will get replaced to ./folder/script.cmd. But this shouldn't make a difference or did you get an error?

I'm absolute agree with you and that relative paths are useful. I really don't see the connection to the replacement of the slash with a backslash.

from idea-batch.

blassmegod avatar blassmegod commented on July 30, 2024

It says that it cannot find ".", but if you use backslash then it's extecuting the script. This is because of how cmd.exe parses the commands and Windows paths. So even if in Windows Explorer you can use slash or backslash in cmd.exe it might have different meaning.

from idea-batch.

tlf30 avatar tlf30 commented on July 30, 2024

This is actually related to my merge request on getting relative paths to work. I am trying to remember as it has been some time now, but there were issues where the script could not get run if it was using \ for some reason.

from idea-batch.

tlf30 avatar tlf30 commented on July 30, 2024

@blassmegod I do not see any issue after looking at the code. You do NOT want to put the period in the Script text field. Use the absolute path in the text field, and the plugin will automagically use relative paths if the absolute path given is inside the project.
When the script is located in the working directory, then only give the name of the script file in the Script text input, and then the path to the script in the working directory text input (as shown):
image

Because in this case the project folder is C:\Users\tlfal_000\Desktop\outside the script will be run as .\dist\server_dist\run_server.bat

EDIT: You can confirm this by looking at the idea run config that is created for the task:

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="run_server" type="BatchConfigurationType" factoryName="Batch">
    <module name="outside" />
    <option name="INTERPRETER_OPTIONS" value="" />
    <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/dist/server_dist" />
    <option name="PARENT_ENVS" value="true" />
    <option name="SCRIPT_NAME" value="run_server.bat" />
    <option name="PARAMETERS" value="" />
    <method v="2" />
  </configuration>
</component>

Take note of the use of `$PROJECT_DIR$ to make the path relative to the project.

from idea-batch.

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.