fix: ignore invalid opencode mode arguments (#302)
Co-authored-by: sanmaxdev <sanmaxdev@users.noreply.github.com>
This commit is contained in:
co-authored by
sanmaxdev
parent
ca4dad252d
commit
a3e0169c3d
@@ -92,7 +92,9 @@ export default async ({ client } = {}) => {
|
||||
'command.execute.before': async (input) => {
|
||||
if (!input || input.command !== 'ponytail') return;
|
||||
// `off` is persisted like any mode; the transform reads it and stays silent.
|
||||
const mode = normalizePersistedMode((input.arguments || '').trim()) || getDefaultMode();
|
||||
const args = (input.arguments || '').trim();
|
||||
const mode = args ? normalizePersistedMode(args) : getDefaultMode();
|
||||
if (!mode) return;
|
||||
writeMode(mode);
|
||||
log('info', 'ponytail ' + mode);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user