scalemax 0.1.8 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/utils/fs.js +6 -1
  2. package/package.json +1 -1
package/dist/utils/fs.js CHANGED
@@ -10,7 +10,12 @@ export async function atomicWrite(file, content, mode = 0o600) {
10
10
  await fs.chmod(file, mode).catch(() => undefined);
11
11
  }
12
12
  export function backupNameFor(file) {
13
- return file.replace(/^([A-Za-z]:)?[\/]/, '').replace(/[\/]/g, '__');
13
+ const withoutDrive = file.replace(/^[A-Za-z]:[\\/]?/, '').replace(/^[\\/]+/, '');
14
+ const safe = withoutDrive
15
+ .replace(/[<>:"\/\\|?*\x00-\x1F]+/g, '__')
16
+ .replace(/[. ]+$/g, '_')
17
+ .replace(/^\.+$/, '_');
18
+ return safe || 'config';
14
19
  }
15
20
  export async function backupFile(file, home) {
16
21
  if (!(await fs.pathExists(file)))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scalemax",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Universal ScaleMax installer for AI coding clients",
5
5
  "type": "module",
6
6
  "bin": {