Giter Site home page Giter Site logo

Comments (10)

joeconwaystk avatar joeconwaystk commented on May 2, 2024

So forgive me for not understanding a thing about Windows, but this would seem to indicate that pub is not in your PATH. What happens when you run pub get from the command line by itself?

from aqueduct.

aelayeb avatar aelayeb commented on May 2, 2024

pub is in my PATH and it works fine, but it seems that the "aqueduct create" fails to switch directory before making the pub get command.

from aqueduct.

joeconwaystk avatar joeconwaystk commented on May 2, 2024

So, it must be here: https://github.com/stablekernel/aqueduct/blob/master/lib/commands/template_creator.dart#L75

The template generator works by creating a directory and putting a pubspec.yaml file in that directory. Then it runs pub get to fetch the entire package, which contains the templates. Then it effectively copies over the template contents to that directory. It's either having problems with setting the CWD to the project directory, or finding the pubspec.yaml file in the project directory.

Would you be able to step through the template generator code on your machine? If you instead clone this repository and reactive aqueduct to point at the local installation (pub global activate -s path path/to/aqueduct), you should be able to dig into the state of the filesystem at this point.

from aqueduct.

aelayeb avatar aelayeb commented on May 2, 2024

Yeah it seems the problem come from this line :
var result = Process.runSync("pub", ["get", "--no-packages-dir"], workingDirectory: projectDirectory.path);
in template_creator.dart.

I tried to do somehing with a minimal code and it failed with the same error.

import 'dart:io';

main () {
    var result = Process.runSync("dir", []);
    if (result.exitCode != 0) {
        throw new Exception("${result.stderr}");
    }
}

("dir" command is equivalent to "ls" on linux)
It's as if the "Process.runSync" method doesn't use the PATH on windows.
I think it's a dart problem, not an aqueduct one.

from aqueduct.

aelayeb avatar aelayeb commented on May 2, 2024

When I add the "runInShell: true" parameter its seems to work but I dont know why it works like this on windows...

from aqueduct.

joeconwaystk avatar joeconwaystk commented on May 2, 2024

Can you also try includeParentEnvironment = true (with runInShell = false)? I wonder if the PATH doesn't get inherited on Windows, and runInShell runs detached in some way so that it does?

from aqueduct.

joeconwaystk avatar joeconwaystk commented on May 2, 2024

Oh nvm, that is already true by default. I'll check to see if runInShell creates issues on macOS and if it doesn't, I'll simply add that to the script.

from aqueduct.

joeconwaystk avatar joeconwaystk commented on May 2, 2024

@aelayeb Would you be able to clone this repo with branch jc/runinshell, then install that as your global aqueduct (pub global activate -spath /path/to/local/) and see if the project creation script works? And potentially the setup script as well?

from aqueduct.

aelayeb avatar aelayeb commented on May 2, 2024

For the "PATH" problem it's good !
Now I have another error :

C:\Users\Jin>aqueduct create -n web_dart
Fetching Aqueduct as:
  aqueduct: "any"
Determining Aqueduct template source...
        Using template source from: /C:/Users/Jin/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/aqueduct-1.0.1.
FileSystemException: Exists failed, path = '/C:/Users/Jin/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/aqueduct-1.0.1/example/templates/default'
(OS Error: La syntaxe du nom de fichier, de r├®pertoire ou de volume est incorrecte.
, errno = 123)

The error says "File, directory or drive name syntax is incorrect" (in french).
I think it's because of the first slash in the directory path.
In Windows there is no things such as the "root" filesystem.
Every drives is mounted with a letter which gives path starting by thoses letters.

The incorrect path comes probably from the package uri resolver I think : https://github.com/stablekernel/aqueduct/blob/jc/runinshell/lib/commands/template_creator.dart#L81

I'll try to figure out what's causing this.

from aqueduct.

aelayeb avatar aelayeb commented on May 2, 2024

I made a PR against your branch which solve the issue on Windows : #111
I don't have a macOS, so if you can try on your side if everything is OK ?

from aqueduct.

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.