Commit Graph

24 Commits

Author SHA1 Message Date
1c07af402b feat(cli): add validation for command options 2025-05-30 12:47:24 +02:00
3d95706d68 feat(validation): add CLI validation helpers for input checks
- Introduce functions to validate CLI inputs like paths, identifiers, and environment variables
- Add error messages for invalid inputs to support user feedback
- Include unit tests to ensure correctness and robustness of validation logic
2025-05-30 12:47:23 +02:00
5226269ec2 style(i18n): add comments for clarity and rename files
- Adds inline comments to JSON files to improve readability
- Renames `.json` files to `.jsonc` to support comments
- Improves organization of translation entries
2025-05-30 11:45:00 +02:00
4ac5dd4c88 feat(i18n): support loading JSONC translation files
- Adds support for `.jsonc` format alongside `.json` for locale files
- Prioritizes `.jsonc` format when both file types are available
2025-05-30 11:44:09 +02:00
c4f4614a2d test(fs): update test descriptions and comments to English
- Translate all test descriptions and inline comments from German to English
2025-05-30 11:21:10 +02:00
6039d236eb test(fs): add rollback tests for writeUnitFiles errors
- Add tests to verify rollback behavior when file writing fails
- Simulate various error scenarios to ensure proper cleanup
- Log rollback failures when file deletion is prohibited
2025-05-30 11:21:10 +02:00
54d71ba3f0 style(i18n): add missing newline at EOF in JSON files
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 2s
CI / build (push) Successful in 7s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 6s
- Ensures JSON files adhere to standard formatting by adding a newline
  at the end of the file.
2025-05-28 18:14:51 +02:00
2a13ee2539 refactor(cli): integrate i18n support across commands
- Centralize CLI text strings using the i18n module for localization
- Refactor `createCommand` and `createCli` to improve modularity
- Update logging and error messages to use translated strings
2025-05-28 18:09:52 +02:00
8efbee1ba9 test(i18n): add unit tests for localization functions
- Add tests for `loadLocale` to verify translations load correctly
- Add tests for `t` to ensure fallback behavior for missing keys
- Add tests for `getCurrentLanguage` to validate language detection logic
2025-05-28 18:09:24 +02:00
bd5ea80aff feat(i18n): add German and English translations for CLI tool
- Introduce localization files for German and English languages
- Provide translations for CLI tool options and error messages
2025-05-28 18:09:16 +02:00
c9b4c8bd71 feat(i18n): add i18n module for localization support
- Introduce functions to initialize and load locale files dynamically
- Add support for translation keys with placeholder replacements
- Default to English if locale files are missing or not found
- Determine system language using environment variables
2025-05-28 18:09:04 +02:00
113103f368 feat(cli): add options for user, home, and working directory
- Add `--run-as` option to specify user for system-wide timers
- Add `--home` option to set the HOME environment variable
- Add `--cwd` option to define the working directory
- Update tests to validate new options and behavior
2025-05-28 14:26:02 +02:00
bd71b8ee14 fix(utils): handle file write failures with rollback
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 5s
- Add error handling and rollback logic for unit file writes
- Prevent partial file writes by removing created files on failure
- Update tests to reflect new return type and error handling
2025-05-21 09:51:16 +02:00
403e047c0c feat(cli): use dynamic version retrieval
- Replace hardcoded version with dynamic retrieval using `getVersion`
- Improves maintainability by avoiding manual version updates
2025-05-21 03:47:14 +02:00
56fb554f13 feat(utils): add version retrieval utility
- Introduces a function to retrieve the application version
- Returns 'dev' if the version file is missing and 'unknown' for other errors
- Exports the new utility for use in other modules
2025-05-21 03:47:02 +02:00
f81bb53353 feat(generator): add systemctl usage instructions
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 6s
- Log systemctl commands for user and root configurations
- Help users reload and enable timers more easily
2025-05-21 03:13:27 +02:00
97dc3fe23a feat(cli): add command to generate systemd unit files
- Introduces a CLI tool for creating systemd .timer and .service units
- Adds options for configuring unit names, commands, scheduling, and more
- Supports dry-run mode and user-level unit file generation
2025-05-21 03:01:21 +02:00
569b14d574 test(generate): add unit tests for service and timer generation
- Introduces tests to validate service and timer unit generation
- Covers description, dependencies, environment variables, and logging
- Ensures generated units meet expected configurations
2025-05-21 03:01:12 +02:00
316f3af04e refactor(utils): update import path for TimerOptions
- Adjusts the import path for TimerOptions to align with the new module structure.
- Simplifies dependency management by consolidating imports.
2025-05-21 03:01:03 +02:00
428e84927f feat(utils): export utility functions for filesystem and naming 2025-05-21 03:00:13 +02:00
ba4b933f78 feat(types): add TimerOptions interface for timer configuration 2025-05-21 02:58:53 +02:00
d5a383a62c feat(cli): add entry point for CLI commands 2025-05-21 02:58:30 +02:00
9539fe0532 feat(utils): add function to derive sanitized job names
- Introduces a utility function to extract and sanitize job names
  from executable paths by removing paths, extensions, and special
  characters.
- Adds unit tests to validate function behavior with various inputs.
2025-05-21 02:58:05 +02:00
ef2ac416d9 test(utils): add unit tests for systemd file handling
- Add tests for writing .service and .timer files with `writeUnitFiles`
- Add tests for resolving target paths with `resolveUnitTargetPath`
- Ensure proper file creation, content validation, and path resolution
2025-05-21 02:57:53 +02:00