Skip to content

Commit

Permalink
CI: remove date from artifacts name (#1)
Browse files Browse the repository at this point in the history
That way it is possible to reference latest version with the same URL.
  • Loading branch information
chrmod authored Feb 22, 2023
1 parent e03b762 commit 70a341f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
5 changes: 1 addition & 4 deletions scripts/export-json/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ import path from 'node:path';
import {
prepareDistFolder,
DIST_PATH,
getCurrentDay,
getSpecs,
} from '../helpers.js';

(async () => {
prepareDistFolder();

const today = getCurrentDay();

const outputPath = path.join(DIST_PATH, `trackerdb_${today}.json`);
const outputPath = path.join(DIST_PATH, 'trackerdb.json');

if (existsSync(outputPath)) {
rmSync(outputPath);
Expand Down
5 changes: 1 addition & 4 deletions scripts/export-sql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import path from 'node:path';
import {
prepareDistFolder,
DIST_PATH,
getCurrentDay,
getSpecs,
} from '../helpers.js';

(async () => {
prepareDistFolder();

const today = getCurrentDay();

const dbPath = path.join(DIST_PATH, `trackerdb_${today}.db`);
const dbPath = path.join(DIST_PATH, 'trackerdb.db');

if (existsSync(dbPath)) {
rmSync(dbPath);
Expand Down
7 changes: 0 additions & 7 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ export function prepareDistFolder() {
}
}

export function getCurrentDay() {
return new Date()
.toISOString()
.replace(/[^0-9]/g, '')
.slice(0, 8);
}

export function getSpecs(kind) {
const specsPath = path.join(process.cwd(), 'db', kind);
const specs = readdirSync(specsPath).filter(
Expand Down

0 comments on commit 70a341f

Please sign in to comment.