mirror of
https://github.com/derfenix/photocatalog.git
synced 2026-03-11 21:35:34 +03:00
Compare commits
6 Commits
v2.0.1
...
a56c582068
| Author | SHA1 | Date | |
|---|---|---|---|
| a56c582068 | |||
| 3be92806b1 | |||
| 65baf34032 | |||
| 986d16addf | |||
| 57eb22615d | |||
| aa6ba0c07c |
11
flake.nix
11
flake.nix
@@ -6,7 +6,7 @@
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
|
||||
version = "2.0.0";
|
||||
version = "2.0.4";
|
||||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
};
|
||||
type = types.attrsOf (types.submodule ({ name, ... }: {
|
||||
# freeformType = settingsFormat.type;
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = types.str;
|
||||
@@ -101,11 +100,11 @@
|
||||
wantedBy = [
|
||||
"default.target"
|
||||
];
|
||||
preStart = if !sync.skipFullSync then ''
|
||||
preStart = if !sync.skipFullSync then (''
|
||||
mkdir -p ${sync.target}
|
||||
photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode}
|
||||
'' else null;
|
||||
script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode}";
|
||||
photocatalog -source ${sync.source} -target ${sync.target} -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}
|
||||
'') else null;
|
||||
script = "photocatalog -source ${sync.source} -target ${sync.target} -skip-full-sync -watch -mode ${sync.mode} ${if sync.overwrite then "-overwrite" else ""}";
|
||||
serviceConfig = {
|
||||
Type="simple";
|
||||
Restart="no";
|
||||
|
||||
@@ -302,9 +302,13 @@ func (o *Organizer) ensureTargetPath(targetPath string) error {
|
||||
for _, part := range strings.Split(relPath, string(filepath.Separator)) {
|
||||
dir = filepath.Join(dir, part)
|
||||
|
||||
if err := os.Mkdir(dir, o.dirMode); err != nil && !os.IsExist(err) {
|
||||
if err := os.Mkdir(dir, os.ModePerm); err != nil && !os.IsExist(err) {
|
||||
return fmt.Errorf("create target directory path at %s: %w", dir, err)
|
||||
}
|
||||
|
||||
if err := os.Chmod(dir, os.ModePerm&o.dirMode); err != nil {
|
||||
return fmt.Errorf("chmod directory %s: %w", dir, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user