mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Merge branch 'master' into feat/eleventy
This commit is contained in:
commit
a17cdb8504
6 changed files with 158 additions and 57 deletions
|
|
@ -187,7 +187,7 @@ export default class AppFilesScanner {
|
|||
// console.log('entries', entries)
|
||||
|
||||
if ( !Array.isArray(entries) ) {
|
||||
file.statusMessage = '❔ Could not decompress file'
|
||||
file.statusMessage = '❔ Could not decompress file. Try extracting the app or using a different app file. '
|
||||
file.status = 'finished'
|
||||
|
||||
throw new Error('Could not decompress file')
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ export default async function () {
|
|||
}
|
||||
|
||||
const category = {
|
||||
label: categoryTitle,
|
||||
slug: categorySlug
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
// Universal JS imports only
|
||||
import slugify from 'slugify'
|
||||
|
||||
|
||||
export function makeCategorySlug ( categoryName ) {
|
||||
return slugify(categoryName, {
|
||||
lower: true,
|
||||
strict: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// Contains all types of properies to keep data consistent
|
||||
|
|
@ -139,5 +148,21 @@ export function getAppCategory (app) {
|
|||
if (typeof app.category === 'undefined') {
|
||||
console.log('app', app)
|
||||
}
|
||||
|
||||
// If this category is not defined yet
|
||||
// then add it
|
||||
if ( !categories.hasOwnProperty( app.category.slug ) ) {
|
||||
// console.log('app', app)
|
||||
|
||||
const customCategory = {
|
||||
id: null,
|
||||
...app.category,
|
||||
}
|
||||
|
||||
categories[app.category.slug] = customCategory
|
||||
|
||||
console.log('Added new category', app.category.slug)
|
||||
}
|
||||
|
||||
return categories[app.category.slug]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue