Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken custom source from file system #612

Closed
haf opened this issue Feb 17, 2015 · 7 comments
Closed

Broken custom source from file system #612

haf opened this issue Feb 17, 2015 · 7 comments
Labels

Comments

@haf
Copy link
Member

haf commented Feb 17, 2015

Trying to create a custom nuget source from the file system, getting this:
`

✗ cat paket.dependencies
source https://www.nuget.org/api/v2
source https://www.myget.org/F/SNIP ...
source ~/.custom-nugets

✗ mono tools/paket.exe update nuget FsSql
Paket version 0.28.0.0
# SNIP
Paket failed with:
    The directory ~/.custom-nugets doesn't exist.
Please check the NuGet source feed definition in your paket.dependencies file.
✗ ls ~/.custom-nugets
FsSql.2.0.1.nupkg
@forki forki added the bug label Feb 17, 2015
@forki
Copy link
Member

forki commented Feb 17, 2015

mhm do you know if this works with the default .NET DirectoryInfo class?

@haf
Copy link
Member Author

haf commented Feb 17, 2015

✗ fsharpi

F# Interactive for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License

For help type #help;;

> open System.IO;;
> new DirectoryInfo("~/dev");;
val it : DirectoryInfo =
  ~/dev {Attributes = 0;
         CreationTime = 1/1/1601 1:00:00 AM;
         CreationTimeUtc = 1/1/1601 12:00:00 AM;
         Exists = false;
         Extension = "";
         FullName = "/Users/henrik.feldt/dev/haf/FsSql/~/dev";
         LastAccessTime = 1/1/1601 1:00:00 AM;
         LastAccessTimeUtc = 1/1/1601 12:00:00 AM;
         LastWriteTime = 1/1/1601 1:00:00 AM;
         LastWriteTimeUtc = 1/1/1601 12:00:00 AM;
         Name = "dev";
         Parent = /Users/henrik.feldt/dev/haf/FsSql/~;
         Root = /;}
> let p = it;;

val p : DirectoryInfo = ~/dev

> p.FullPath;;

  p.FullPath;;
  ^^^^^^^^^^

/Users/henrik.feldt/dev/haf/FsSql/stdin(4,1): error FS1097: The struct or class field 'FullPath' is not accessible from this code location
> p.FullName;;
val it : string = "/Users/henrik.feldt/dev/haf/FsSql/~/dev"
> p.GetFiles();;
System.IO.DirectoryNotFoundException: Directory '/Users/henrik.feldt/dev/haf/FsSql/~/dev' not found.
  at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
  at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
  at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
  at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) [0x00000] in <filename unknown>:0
  at System.IO.DirectoryInfo.GetFiles () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles ()
  at <StartupCode$FSI_0007>.$FSI_0007.main@ () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Stopped due to error

@forki
Copy link
Member

forki commented Feb 17, 2015

So it mono doesn't understand that, right? How can we work around this?
On Feb 17, 2015 1:42 PM, "Henrik Feldt" [email protected] wrote:

✗ fsharpi

F# Interactive for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License

For help type #help;;

open System.IO;;
new DirectoryInfo("/dev");;
val it : DirectoryInfo =
/dev {Attributes = 0;
CreationTime = 1/1/1601 1:00:00 AM;
CreationTimeUtc = 1/1/1601 12:00:00 AM;
Exists = false;
Extension = "";
FullName = "/Users/henrik.feldt/dev/haf/FsSql/
/dev";
LastAccessTime = 1/1/1601 1:00:00 AM;
LastAccessTimeUtc = 1/1/1601 12:00:00 AM;
LastWriteTime = 1/1/1601 1:00:00 AM;
LastWriteTimeUtc = 1/1/1601 12:00:00 AM;
Name = "dev";
Parent = /Users/henrik.feldt/dev/haf/FsSql/
;
Root = /;}
let p = it;;

val p : DirectoryInfo = ~/dev

p.FullPath;;

p.FullPath;;
^^^^^^^^^^

/Users/henrik.feldt/dev/haf/FsSql/stdin(4,1): error FS1097: The struct or class field 'FullPath' is not accessible from this code location

p.FullName;;
val it : string = "/Users/henrik.feldt/dev/haf/FsSql//dev"
p.GetFiles();;
System.IO.DirectoryNotFoundException: Directory '/Users/henrik.feldt/dev/haf/FsSql/
/dev' not found.
at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in :0
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in :0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in :0
at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) [0x00000] in :0
at System.IO.DirectoryInfo.GetFiles () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:GetFiles ()
at <StartupCode$FSI_0007>.$FSI_0007.main@ () [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Stopped due to error


Reply to this email directly or view it on GitHub
#612 (comment).

@haf
Copy link
Member Author

haf commented Feb 17, 2015

Regex.Replace("^~", Environment.GetSpecialDirectory(SpecialDirectories.HomeDirectory))?

@haf
Copy link
Member Author

haf commented Feb 17, 2015

Another workaround: use the HOME env var http://stackoverflow.com/a/3291314/63621

@forki forki closed this as completed in fad2208 Feb 17, 2015
@forki
Copy link
Member

forki commented Feb 17, 2015

I tested it on windows and it used my home dir. please give it a try.

@haf
Copy link
Member Author

haf commented Feb 17, 2015

Works nicely ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants