Skip to content

Commit d3b697e

Browse files
committed
Sanitize title for archive name
1 parent 3a3c73a commit d3b697e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/dataset/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import publishRelease from './publish/index.js';
99

1010
export async function release({ shouldPublish, shouldRemoveLocalCopy, fileName }) {
1111
const releaseDate = new Date();
12-
const archiveName = fileName || `dataset-${config.get('@opentermsarchive/engine.dataset.title')}-${releaseDate.toISOString().replace(/T.*/, '')}`;
12+
const archiveName = fileName || `${config.get('@opentermsarchive/engine.dataset.title').toLowerCase().replace(/[^a-zA-Z0-9.\-_]/g, '-')}-${releaseDate.toISOString().replace(/T.*/, '')}`;
1313
const archivePath = `${path.basename(archiveName, '.zip')}.zip`; // allow to pass filename or filename.zip as the archive name and have filename.zip as the result name
1414

1515
logger.info('Start exporting dataset…');

0 commit comments

Comments
 (0)