mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Apple saveMethod to api saves
This commit is contained in:
parent
dc27e091d2
commit
7b795d7245
1 changed files with 7 additions and 3 deletions
|
|
@ -168,8 +168,7 @@ class BuildLists {
|
||||||
|
|
||||||
const typeWithRelatedVideos = new Set([
|
const typeWithRelatedVideos = new Set([
|
||||||
'app',
|
'app',
|
||||||
'formula',
|
'formula'
|
||||||
// 'video'
|
|
||||||
])
|
])
|
||||||
|
|
||||||
return typeWithRelatedVideos.has( appType )
|
return typeWithRelatedVideos.has( appType )
|
||||||
|
|
@ -503,11 +502,16 @@ class BuildLists {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasSaveMethod = listOptions.hasOwnProperty('beforeSave')
|
||||||
|
const saveMethod = hasSaveMethod ? listOptions.beforeSave : listSet => Array.from( listSet )
|
||||||
|
|
||||||
|
const [ saveableEntry ] = saveMethod( new Set( [ listEntry ] ) )
|
||||||
|
|
||||||
// Ensure the directory exists
|
// Ensure the directory exists
|
||||||
await fs.ensureDir( endpointDirectory )
|
await fs.ensureDir( endpointDirectory )
|
||||||
|
|
||||||
// Write the endpoint to JSON
|
// Write the endpoint to JSON
|
||||||
await this.saveToJson( listEntry, endpointPath )
|
await this.saveToJson( saveableEntry, endpointPath )
|
||||||
})
|
})
|
||||||
|
|
||||||
if ( errors.length !== 0 ) {
|
if ( errors.length !== 0 ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue