mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: push new pwd when 'cd'
This commit is contained in:
1 parent
096b7a7714
commit
f08ee333a7
3 files changed
+12
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import minimist from 'minimist'
|
||||
import Quest from '../models/quest.js'
|
||||
import { pushToSession } from '../api/socket.js'
|
||||
|
||||
@@ -18,11 +19,15 @@ async function commandHandler(session, commandInput, additionalData) {
|
||||
return {}
|
||||
}
|
||||
|
||||
const argv = minimist(commandInput.command.split(' '))
|
||||
|
||||
if ('discover' in additionalData) {
|
||||
pushToSession(session.id, 'graph', {
|
||||
pwd: commandInput.pwd,
|
||||
discover: additionalData.discover,
|
||||
})
|
||||
} else if (argv._[0] === 'cd') {
|
||||
pushToSession(session.id, 'graph', { pwd: commandInput.pwd })
|
||||
}
|
||||
|
||||
const commandMatch = checkMatch(stage.condition.command, commandInput.command)
|
||||
|
||||
Reference in new issue
Block a user