feat(seed): add dasherized titles to unpacked filenames
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
966b138f83
commit
4a77ba7af3
@@ -2,6 +2,7 @@
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
import { dasherize } from '../common/utils';
|
||||
|
||||
const jsonLinePrefix = '//--JSON:';
|
||||
const paragraphBreak = '<!--break-->';
|
||||
@@ -28,7 +29,6 @@ class ChallengeFile {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
readChunks() {
|
||||
// todo: make this work async
|
||||
// todo: make sure it works with encodings
|
||||
@@ -142,7 +142,7 @@ class UnpackedChallenge {
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
let prefix = ((this.index < 10) ? '00' : (this.index < 100) ? '0' : '')
|
||||
+ this.index;
|
||||
return `${prefix}-${this.challenge.id}`;
|
||||
return `${prefix}-${dasherize(this.challenge.title)}-${this.challenge.id}`;
|
||||
}
|
||||
|
||||
expandedDescription() {
|
||||
|
Reference in New Issue
Block a user