- Configurable server URL (default: pedshub.com) - Android + iOS platforms initialized - Dark theme matching quiz app (#0f172a) - Status bar and navigation bar color matched - Auto-redirect on subsequent launches - App ID: com.pedshub.quiz, App Name: PedsHub Build: cd mobile && npx cap sync && npx cap open android Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
947 B
JavaScript
40 lines
947 B
JavaScript
'use strict'
|
|
|
|
const u = require('universalify').fromCallback
|
|
const fs = require('graceful-fs')
|
|
const path = require('path')
|
|
const mkdir = require('../mkdirs')
|
|
const pathExists = require('../path-exists').pathExists
|
|
|
|
function outputFile (file, data, encoding, callback) {
|
|
if (typeof encoding === 'function') {
|
|
callback = encoding
|
|
encoding = 'utf8'
|
|
}
|
|
|
|
const dir = path.dirname(file)
|
|
pathExists(dir, (err, itDoes) => {
|
|
if (err) return callback(err)
|
|
if (itDoes) return fs.writeFile(file, data, encoding, callback)
|
|
|
|
mkdir.mkdirs(dir, err => {
|
|
if (err) return callback(err)
|
|
|
|
fs.writeFile(file, data, encoding, callback)
|
|
})
|
|
})
|
|
}
|
|
|
|
function outputFileSync (file, ...args) {
|
|
const dir = path.dirname(file)
|
|
if (fs.existsSync(dir)) {
|
|
return fs.writeFileSync(file, ...args)
|
|
}
|
|
mkdir.mkdirsSync(dir)
|
|
fs.writeFileSync(file, ...args)
|
|
}
|
|
|
|
module.exports = {
|
|
outputFile: u(outputFile),
|
|
outputFileSync
|
|
}
|