Skip to content

Commit

Permalink
fix: temporary rollback store init function
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalygashkov committed Nov 29, 2024
1 parent 5e7ff51 commit 1d2ca75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/cli
Submodule cli updated from 836134 to d3e4b9
15 changes: 9 additions & 6 deletions packages/core/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { getSettings } from './settings';
import { importCookies } from './cookies';

const createStorePath = (name: string) => {
// TODO: Make new store filename format
// const storePath = join(getSettings().servicesDir, `${name}.json`);
// if (fs.exists(storePath)) return storePath;

// Old store support
const oldStoreDir = initDir(join(getSettings().servicesDir, name));
const oldStorePath = join(oldStoreDir, 'config.json');
const storePath = join(getSettings().servicesDir, `${name}.json`);
// Migrate from old store to new store
if (fs.exists(oldStorePath)) {
fs.renameSync(oldStorePath, storePath);
fs.delete(oldStorePath).then(() => fs.delete(oldStoreDir));
}
return storePath;
// if (fs.exists(oldStorePath)) {
// fs.readText(oldStorePath).then((data) => fs.writeText(storePath, data));
// }
return oldStorePath;
};

const getCookiesFromTxt = async (dir: string) => {
Expand Down

0 comments on commit 1d2ca75

Please sign in to comment.