sync

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorAuto   = "auto"
	ColorAlways = "always"
	ColorNever  = "never"
)

ColorAuto etc は push/pull --dry-run の --color 値を表す。auto は FORCE_COLOR > NO_COLOR > tty 判定。

Variables

This section is empty.

Functions

func Pull

func Pull(storeRoot string, entries []config.Entry) ([]config.Entry, error)

Pull は dest を Store の src へファイルコピーする。 Entry の src は Store 相対、dest は ~ 展開される配置先パス。 Push と同じく親ディレクトリは mkdir -p、パーミッションは元ファイルに追従。 override=false で Store 側に既存ファイルがある場合は上書きせず skip して継続し、 不在時のみ新規作成する。省略時(true)は従来通り上書きする。 dest が不在・ディレクトリの場合はエラーで中断する。Store 側がディレクトリの場合もエラーになる。 skip 時は内容・権限を変更しない。戻り値は skip した Entry 群である。

func PullDryRun added in v0.0.8

func PullDryRun(storeRoot string, entries []config.Entry, colorMode string) (string, bool, error)

PullDryRun は pull のプレビューを Store→dest 方向で返す。書き込みは行わない。 pullで取り込まれる行が+になるよう Store を old、dest を new とする。 override=false でコピー先が存在する Entry は無出力・差分なし扱いとし、skip 報告はしない。

func Push

func Push(storeRoot string, entries []config.Entry) ([]config.Entry, error)

Push は Store の src を dest へファイルコピーする。 Entry の src は Store 相対、dest は ~ 展開される配置先パス。 親ディレクトリは mkdir -p、パーミッションは元ファイルに追従。 override=false でコピー先に既存ファイルがある場合は上書きせず skip して継続し、 不在時のみ新規作成する。省略時(true)は従来通り上書きする。 src/dest がディレクトリの場合はエラーで中断する。src 不在もエラーで中断する。 skip 時は内容・権限を変更しない。戻り値は skip した Entry 群である。

func PushDryRun added in v0.0.8

func PushDryRun(storeRoot string, entries []config.Entry, colorMode string) (string, bool, error)

PushDryRun は push のプレビューを dest→Store 方向で返す。書き込みは行わない。 pushで追加される行が+になるよう dest を old、Store を new とする。 両方存在する Entry は inline diff を出し、片方不在の Entry は新規作成予定として報告する。 override=false でコピー先が存在する Entry は無出力・差分なし扱いとし、skip 報告はしない。 両方不在・ディレクトリはエラーで中断する。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL