mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
Merge branch 'quest-file' into quest
This commit is contained in:
commit
956af624c6
69 files changed
+1232
-260
No files matched your search
@@ -85,4 +85,12 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
main().then(exit)
|
||||
main()
|
||||
.then(exit)
|
||||
.catch((err) => {
|
||||
console.log(
|
||||
'發生預期外的錯誤,請嘗試重新啟動 Quest,如果問題持續發生,請幫我們填寫右上角的錯誤回報表單。'
|
||||
)
|
||||
console.error(err)
|
||||
exit(1)
|
||||
})
|
||||
@@ -34,12 +34,16 @@ async function collectFilesInfo(inputPath, level = 0, hiddenFiles = false) {
|
||||
|
||||
async function discoverFiles(argv) {
|
||||
const targetPath = argv._.length < 2 ? ['.'] : argv._.slice(1)
|
||||
const result = await Promise.all(
|
||||
targetPath
|
||||
.map((p) => path.resolve(process.cwd(), p))
|
||||
.map((p) => collectFilesInfo(p, 0, argv.a || argv.all))
|
||||
)
|
||||
return { discover: result.flat() }
|
||||
try {
|
||||
const result = await Promise.all(
|
||||
targetPath
|
||||
.map((p) => path.resolve(process.cwd(), p))
|
||||
.map((p) => collectFilesInfo(p, 0, argv.a || argv.all))
|
||||
)
|
||||
return { discover: result.flat() }
|
||||
} catch (err) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = discoverFiles
|
||||
@@ -3,10 +3,12 @@ import { model, Schema } from 'mongoose'
|
||||
const responseSchema = new Schema({
|
||||
type: {
|
||||
type: String,
|
||||
enum: ['narrative', 'dialogue'],
|
||||
default: 'dialogue',
|
||||
required: true,
|
||||
},
|
||||
content: [String],
|
||||
speaker: String,
|
||||
speaker: { type: String, default: 'Ada' },
|
||||
color: String,
|
||||
})
|
||||
|
||||
|
||||
@@ -35,10 +35,12 @@ const Session = model(
|
||||
user: {
|
||||
type: Schema.ObjectId,
|
||||
ref: 'User',
|
||||
required: true,
|
||||
},
|
||||
quest: {
|
||||
type: String,
|
||||
ref: 'Quest',
|
||||
required: true,
|
||||
},
|
||||
containerId: String,
|
||||
status: {
|
||||
|
||||
Reference in new issue
Block a user