tackler 25.4.2

Fast, reliable bookkeeping tool with native GIT SCM support for plain text accounting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Tackler-NG 2025
 * SPDX-License-Identifier: Apache-2.0
 */
use crate::commands::init;
use std::fs;
use std::path::Path;
use tackler_core::tackler;

pub(crate) fn exec(exe_name: &str, name: &str) -> Result<Option<String>, tackler::Error> {
    if fs::exists(name)? {
        let p = Path::new(name).canonicalize()?;
        return Err(format!("destination `{}` already exists", &p.display()).into());
    }
    fs::create_dir_all(name)?;

    init::exec(exe_name, name)
}