Skip to content

Commit

Permalink
fix: update retain old config filepath.
Browse files Browse the repository at this point in the history
  • Loading branch information
icycodes committed Oct 27, 2023
1 parent 3bb1605 commit d11c9a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/tabby-agent/src/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const userAgentConfig = isBrowser
: (() => {
const EventEmitter = require("events");
const fs = require("fs-extra");
const path = require("path");
const toml = require("toml");
const chokidar = require("chokidar");
const deepEqual = require("deep-equal");
Expand Down Expand Up @@ -187,7 +188,7 @@ export const userAgentConfig = isBrowser
async migrateConfig(config) {
try {
const prefix = new Date().toISOString().replace(/\D+/g, "");
const target = `${prefix}-${this.filepath}`;
const target = path.join(path.dirname(this.filepath), `${prefix}-config.toml`);
await fs.move(this.filepath, target);
await fs.outputFile(this.filepath, generateConfigFile(true, config));
this.logger.info(`Migrated config file to ${target}.`);
Expand Down

0 comments on commit d11c9a8

Please sign in to comment.