Commit Graph

16 Commits

Author SHA1 Message Date
ronyweng e597de429b Fix BasePathFs symlink
1. Support related path
2. Make ReadlinkIfPossible return path under basepath

Fixes #282
2020-12-28 14:05:51 +08:00
Michail Kargakis 90f4ffe95f
Gofmt the project 2020-04-10 23:59:22 +02:00
Bjørn Erik Pedersen 63644898a8
Return os.ErrNotExist in BasePathFs on abs URLs on Windows
So it can be used in a composite filesystem.

Fixes #162
2018-04-01 22:57:52 +02:00
Albert Z Wang 3d990a0494 remove debug output 2017-12-12 20:08:50 -05:00
Albert Z Wang 4f332f79e7 clean paths in test comparisons 2017-11-29 14:01:03 -05:00
Albert Z Wang f12a645649 add tests (thanks to @ts2909)
* copied from 6c031db617
2017-11-29 13:44:12 -05:00
Francois Hill (fhill-wks) 3c4cfa198e Add `FullBaseFsPath` utility method
This method resolves the "Full" path of the `BasePathFs`. It also resolves for nested BasePaths.
Unit tests were also added
2016-04-20 14:12:23 +02:00
Francois Hill (home win10) 7b5e657cdb Revert the previous `fullPath` changes and add tests for "nested" `BasePath`'s 2016-04-20 03:23:58 +02:00
Francois Hill (dell laptop) 8e75131a67 Closes spf13/afero#79
Amendment to previous commit, fixed the related test
2016-04-18 20:17:01 +02:00
Francois Hill (dell laptop) 9a1fcfb267 Closes spf13/afero#79
Added fix to support "nested" `BasePathFs`. Unit-tests are also included.
2016-04-18 19:29:19 +02:00
bep ddb4d0857d Improve absolute file paths handling in BasePathFs
A common mistake in using the BasePathFs is to give it a real
OS absolute file path instead of a virtual one relative to the virtual base.

This commit adds some tests and returns an error on Windows in this case.

On Unix we have to train the users to do a better job.

See https://github.com/spf13/hugo/issues/1800
2016-02-15 19:09:17 +01:00
Steve Francia 220647edb9 Permit accessing basePath root in BasePathFs (with test) 2016-01-12 00:34:15 -05:00
Steve Francia fe8e895336 Migrate all backends & readme to use constructorish New... 2016-01-11 21:41:03 -05:00
Steve Francia a3ed628486 refine BasePathFs implementation 2016-01-11 20:48:25 -05:00
Steve Francia da00b1fb7c port BasePathFs from filter to filesystem 2016-01-11 20:48:25 -05:00
Hanno Hecker 205066d391 Add BasePathFs as FilterFs
* add a BasePathFs implemented as FilterFs:
  The BasePathFs restricts all operations to a given path within an Fs.
  The given file name to the operations on this Fs will be prepended
  with the base path before calling the base Fs.
  Any file name (after filepath.Clean()) outside this base path will be
  treated as non existing file.

* fix meaning of "facere" - "facio" means "I do", "facere" is the base
  form
2016-01-11 13:21:51 -05:00