Skip to content

Commit

Permalink
Bump to v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Aug 30, 2024
1 parent 8bedf5c commit aa72abe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minifolio",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"license": "GPL-3.0-only",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions src/lib/server/data/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ export type MigrationFunction = (dataDir: string) => Promise<void>;
const migrations: Record<string, MigrationFunction> = {
'~0.1.0': migrateFromV010,
'~0.2.0': migrateFromV020,
'~0.3.0': updateConfigVersions,
};

/** Update config versions (only for minor, non-breaking changes to config.json) */
export async function updateConfigVersions() {
export async function updateConfigVersions(dataDir: string) {
const config = await getConfig();
config.version = version;
await setConfig(config);
Expand All @@ -38,7 +39,9 @@ export default async function migrate(oldVersion: string) {
// calls getConfig and getLocalConfig without specifying the desired
// directory to load from).
try {
return await migrateFunction(getDataDir());
await migrateFunction(getDataDir());
console.log('Migration success');
return;
} catch (e) {
console.log('!!! Error during migration');
console.log(e);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/data/migrations/v0.2.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { unsafeLoadGroupInfo } from './unsafeLoad';
export default async function migrate(dataDir: string) {
console.log(`Migrate from v0.2.x -> ${version}`);

await updateConfigVersions();
await updateConfigVersions(dataDir);

// For each group
for (const groupId of await listGroups()) {
Expand Down

0 comments on commit aa72abe

Please sign in to comment.