memoir-cli 1.0.0 → 1.1.1
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/README.md +1 -0
- package/package.json +1 -1
- package/src/adapters/index.js +9 -0
- package/src/config.js +3 -1
- package/src/providers/index.js +2 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/adapters/index.js
CHANGED
|
@@ -22,6 +22,15 @@ export const adapters = [
|
|
|
22
22
|
const basename = path.basename(src);
|
|
23
23
|
return !basename.endsWith('.key') && basename !== '.env';
|
|
24
24
|
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'OpenAI Codex',
|
|
28
|
+
source: path.join(home, '.codex'),
|
|
29
|
+
filter: (src) => {
|
|
30
|
+
const basename = path.basename(src);
|
|
31
|
+
const ignored = ['.git', 'sessions', 'cache'];
|
|
32
|
+
return !ignored.includes(basename) && !basename.endsWith('.key') && basename !== '.env';
|
|
33
|
+
}
|
|
25
34
|
}
|
|
26
35
|
];
|
|
27
36
|
|
package/src/config.js
CHANGED
|
@@ -2,7 +2,9 @@ import fs from 'fs-extra';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
4
|
|
|
5
|
-
const CONFIG_DIR =
|
|
5
|
+
const CONFIG_DIR = process.platform === 'win32'
|
|
6
|
+
? path.join(process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming'), 'memoir')
|
|
7
|
+
: path.join(os.homedir(), '.config', 'memoir');
|
|
6
8
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
7
9
|
|
|
8
10
|
export async function getConfig() {
|
package/src/providers/index.js
CHANGED
|
@@ -28,7 +28,8 @@ export async function syncToGit(config, stagingDir, spinner) {
|
|
|
28
28
|
execSync('git init', { cwd: stagingDir, stdio: 'ignore' });
|
|
29
29
|
execSync('git branch -m main', { cwd: stagingDir, stdio: 'ignore' });
|
|
30
30
|
execSync('git add .', { cwd: stagingDir, stdio: 'ignore' });
|
|
31
|
-
execSync('git config user.name "memoir"
|
|
31
|
+
execSync('git config user.name "memoir"', { cwd: stagingDir, stdio: 'ignore' });
|
|
32
|
+
execSync('git config user.email "bot@memoir.dev"', { cwd: stagingDir, stdio: 'ignore' });
|
|
32
33
|
execSync('git commit -m "chore: memoir backup"', { cwd: stagingDir, stdio: 'ignore' });
|
|
33
34
|
|
|
34
35
|
spinner.text = `Pushing data to ${chalk.cyan(repoUrl)}...`;
|