mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 06:59:42 +02:00
chore: bump version to 0.1485
This commit is contained in:
@@ -34,3 +34,4 @@ export {
|
||||
todoContentHash,
|
||||
} from './string-similarity.js';
|
||||
export { assertNever } from './type-safety.js';
|
||||
export { wrapWithNice } from './nice-wrapper.js';
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @fileoverview Shared utility for wrapping commands with `nice` priority.
|
||||
*
|
||||
* Extracted from screen-manager.ts so both tmux-manager and screen-manager
|
||||
* can use it without cross-dependency on the deprecated screen module.
|
||||
*
|
||||
* @module utils/nice-wrapper
|
||||
*/
|
||||
|
||||
import type { NiceConfig } from '../types.js';
|
||||
|
||||
/**
|
||||
* Wraps a command with `nice` for priority adjustment.
|
||||
*/
|
||||
export function wrapWithNice(cmd: string, config: NiceConfig): string {
|
||||
if (!config.enabled) return cmd;
|
||||
const niceValue = Math.max(-20, Math.min(19, config.niceValue));
|
||||
return `nice -n ${niceValue} ${cmd}`;
|
||||
}
|
||||
Reference in New Issue
Block a user