testdriverai 4.0.35 → 4.0.36
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/index.js +5 -2
- package/lib/init.js +1 -1
- package/lib/sdk.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -70,7 +70,8 @@ let getArgs = () => {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
if (!args[file]) {
|
|
73
|
-
|
|
73
|
+
if (!fs.existsSync(path.join(process.cwd(), 'testdriver'))) {
|
|
74
|
+
args[file] = 'testdriver/testdriver.yml'
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
// turn args[file] into local path
|
|
@@ -457,7 +458,9 @@ const generate = async (type) => {
|
|
|
457
458
|
for (const testPrompt of testPrompts) {
|
|
458
459
|
// with the contents of the testPrompt
|
|
459
460
|
let fileName = sanitizeFilename(testPrompt.headings[0]).trim().replace(/ /g, '-').toLowerCase() + '.md';
|
|
460
|
-
let path1 = path.join(process.cwd(), 'testdriver', '
|
|
461
|
+
let path1 = path.join(process.cwd(), 'testdriver', 'generate', fileName);
|
|
462
|
+
// create generate directory if it doesn't exist
|
|
463
|
+
if (!fs.existsSync(path.join(process.cwd(), 'testdriver', 'generate'))) {
|
|
461
464
|
let contents = testPrompt.listsOrdered[0].map((item, index) => `${index + 1}. /explore ${item}`).join('\n');
|
|
462
465
|
fs.writeFileSync(path1, contents);
|
|
463
466
|
}
|
package/lib/init.js
CHANGED
|
@@ -137,7 +137,7 @@ module.exports = async () => {
|
|
|
137
137
|
fs.mkdirSync(testdriverFolder);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
const testdriverGenerateFolder = path.join(process.cwd(), 'testdriver', '
|
|
140
|
+
const testdriverGenerateFolder = path.join(process.cwd(), 'testdriver', 'generate');
|
|
141
141
|
if (!fs.existsSync(testdriverGenerateFolder)) {
|
|
142
142
|
fs.mkdirSync(testdriverGenerateFolder);
|
|
143
143
|
}
|
package/lib/sdk.js
CHANGED