ramm 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ramm.js CHANGED
@@ -222,6 +222,9 @@ var formatUserspace = (command, context = defaultContext) => {
222
222
  const userPart = context.userspace ? " --user " : "";
223
223
  return "systemctl" + userPart + " " + command.slice(systemctlWordLangth);
224
224
  };
225
+ var reloadSystemd = async (context = defaultContext) => {
226
+ await execCommand(formatUserspace("systemctl daemon-reload", context));
227
+ };
225
228
  var startSystemdUnit = async (unitName, context = defaultContext) => {
226
229
  await execCommand(formatUserspace(`systemctl start ${unitName}`, context));
227
230
  };
@@ -241,7 +244,7 @@ var checkSystemdUnit = async (serviceName, context = defaultContext) => {
241
244
  var createSystemdUnit = async (unitName, content, context = defaultContext) => {
242
245
  const pathToSeviceTarget = getSystemdPathToService(unitName, context);
243
246
  await writeFileFull(pathToSeviceTarget, content);
244
- await execCommand(formatUserspace(`systemctl daemon-reload ${unitName}`, context));
247
+ await reloadSystemd(context);
245
248
  };
246
249
  var getSystemdPathToService = (serviceName, context = defaultContext) => {
247
250
  if (context.userspace) {
@@ -251,8 +254,8 @@ var getSystemdPathToService = (serviceName, context = defaultContext) => {
251
254
  };
252
255
  var createSystemdService = async (serviceName, content, context = defaultContext) => {
253
256
  await createSystemdUnit(serviceName, content, context);
254
- await enabledSystemdUnit(`systemctl enable ${serviceName}`, context);
255
- await startSystemdUnit(`systemctl start ${serviceName}`, context);
257
+ await enabledSystemdUnit(serviceName, context);
258
+ await startSystemdUnit(serviceName, context);
256
259
  };
257
260
 
258
261
  // src/nft.ts
@@ -491,6 +494,7 @@ export {
491
494
  runPodmanContainerService,
492
495
  runPodmanContainer,
493
496
  restartSystemdUnit,
497
+ reloadSystemd,
494
498
  printBlock,
495
499
  passVarsServer,
496
500
  passVarsClient,
@@ -3,7 +3,7 @@ export { Context } from "./context.ts";
3
3
  export { installBun } from "./init.ts";
4
4
  export { installPodman, runPodmanContainer, loginPodman } from "./podman.ts";
5
5
  export { runPodmanContainerService, addNftPodmanRule } from "./podman.ts";
6
- export { startSystemdUnit, enabledSystemdUnit, restartSystemdUnit, createSystemdService, getSystemdPathToService, createSystemdUnit, } from "./systemd.ts";
6
+ export { startSystemdUnit, enabledSystemdUnit, restartSystemdUnit, createSystemdService, getSystemdPathToService, createSystemdUnit, reloadSystemd, } from "./systemd.ts";
7
7
  export { installSystemPackage } from "./packages.ts";
8
8
  export { printBlock } from "./print.ts";
9
9
  export { setupNftable } from "./nft.ts";
@@ -1,4 +1,5 @@
1
1
  import { Context } from "./context.ts";
2
+ export declare const reloadSystemd: (context?: Context) => Promise<void>;
2
3
  export declare const startSystemdUnit: (unitName: string, context?: Context) => Promise<void>;
3
4
  export declare const enabledSystemdUnit: (unitName: string, context?: Context) => Promise<void>;
4
5
  export declare const restartSystemdUnit: (name: string, context?: Context) => Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.42",
4
+ "version": "0.0.44",
5
5
  "scripts": {
6
6
  "build": "bun build ./src/ramm.ts --target bun --outdir ./dist && cp ./src/bun.sh ./dist/bun.sh",
7
7
  "types": "tsc --project tsconfig.types.json"