[breaking change] normalize localRoot to absolute path #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
blogConfig.LocalPathを設定読み込み時に絶対パスに正規化して統一するようにしたい。また、設定ファイルに相対パスが指定されていた場合に、設定ファイルからの相対位置に解決することとしたい。これは統一感や将来の機能拡張のため。具体的には例えば
blogsync push
でファイルの配置位置がどのブログのエントリーか判別するためなどにそのようにしたい。設定ファイルの位置からの相対位置で絶対パスを解決するようにすると、グローバル設定 (.config/blogsync/config.yaml) に相対パスが設定されていた場合に非互換変更になる。現状はblogsync実行位置からの相対位置でLocalRootが解決されるため。ローカル設定 (blogsync.yaml) の場合は、blogsync実行ディレクトリとファイル配置ディレクトリが同一なので非互換変更にはならない。
ただ、一般的には設定ファイルからの相対位置で相対パスが解決されることが期待されると思うし、実際blogsyncの実行パスによって、エントリーがpullされてくる位置がコロコロ変わるのもおかしな話だと思う。なので、できれば挙動を変えたい。
以下の選択肢がある。
.config/blogsync/config.yaml
からの相対パスにファイルが書き込まれるの嫌な感じがするのでこれはfool proof的にはやったほうが良いかも今の実装は4。3にはしても良いかも知れない。
→ 3にするのそこをケアするためにコードを複雑にしても仕方ないので一旦実装なくていいかと思った。