valgene / valgene-cli

Multi language validation code and DTO generator from OpenAPI specification.
https://pub.dartlang.org/packages/valgene_cli
Apache License 2.0
8 stars 1 forks source link

running on windows issue #5

Open abegalinov opened 5 years ago

abegalinov commented 5 years ago
C:\Users\xxxx\PhpstormProjects\xxxx>valgene --template php5.5 --spec api.spec.yaml --option 'php.namespace:\xxxxx\xxxx
Unhandled exception:
FileSystemException: Exists failed, path = 'C:\Users\xxxx\PhpstormProjects\xxxx\/C:/Users/xxxx/AppData/Roaming/Pub/Cache/global_packages/valgene_cli/templates
/php5.5' (OS Error: The filename, directory name, or volume label syntax is incorrect.
, errno = 123)
#0      _Directory.existsSync (dart:io/directory_impl.dart:101:7)
#1      Cli.getTemplateFolder (package:valgene_cli/valgene_cli.dart:69:14)
#2      Cli.execute (package:valgene_cli/valgene_cli.dart:52:60)
#3      main (file:///C:/Users/xxxx/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/valgene_cli-1.0.3/bin/valgene.dart:6:9)
#4      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
Unhandled exception:
FileSystemException: Exists failed, path = 'C:\Users\xxxx\PhpstormProjects\xxxx\/C:/Users/xxxx/AppData/Roaming/Pub/Cache/global_packages/valgene_cli/templates
/php5.5' (OS Error: The filename, directory name, or volume label syntax is incorrect.
, errno = 123)
#0      _Directory.existsSync (dart:io/directory_impl.dart:101:7)
#1      Cli.getTemplateFolder (package:valgene_cli/valgene_cli.dart:69:14)
#2      Cli.execute (package:valgene_cli/valgene_cli.dart:52:60)
#3      main (file:///C:/Users/xxxx/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/valgene_cli-1.0.3/bin/valgene.dart:6:9)
#4      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
sassman commented 5 years ago

seems that the template path determination under windows behaves different from OSX.

sassman commented 5 years ago

For windows there would be one workaround, you have to name the template folder explicit by setting the --template-folder to the the local dart pub cache folder like %APPDATA%/Pub/Cache/hosted/pub.dartlang.org/valgene_cli-1.0.3/templates/php5.5

the full command then would look like this:

valgene --template php5.5 \
  --template-folder %APPDATA%/Pub/Cache/hosted/pub.dartlang.org/valgene_cli-1.0.3/templates/php5.5 \
  --spec api.spec.yaml \
  --option "php.namespace:\xxxxx\xxxx"