Skip to content

Commit

Permalink
chore(icongenie): small code style improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Dec 14, 2024
1 parent 5d823b0 commit 0590595
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
12 changes: 4 additions & 8 deletions icongenie/lib/mount/mount-cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,18 @@ function hasDeepProp (target /* , param1, param2, ... */) {
function installSplashscreenPlugin () {
const pkgPath = resolveDir('src-cordova/package.json')

if (!existsSync(pkgPath)) {
// malformed /src-cordova...
return
}
// malformed /src-cordova...
if (!existsSync(pkgPath)) return

const pkg = JSON.parse(
readFileSync(pkgPath, 'utf8')
)

if (
// it's already installed, so nothing to do
hasDeepProp(pkg, 'dependencies', 'cordova-plugin-splashscreen')
|| hasDeepProp(pkg, 'cordova', 'plugins', 'cordova-plugin-splashscreen')
) {
// it's already installed, so nothing to do
return
}
) return

log(`Installing cordova-plugin-splashscreen...`)

Expand Down
4 changes: 1 addition & 3 deletions icongenie/lib/mount/mount-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { log } from '../utils/logger.js'
export function mountTag (files) {
const tagFiles = files.filter(file => file.tag)

if (tagFiles.length === 0) {
return
}
if (tagFiles.length === 0) return

console.log()
log(`You will need the following tags in your /index.html or /src/index.template.html:\n`)
Expand Down
12 changes: 3 additions & 9 deletions icongenie/lib/utils/parse-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ function die (msg) {
}

function profile (value, argv) {
if (!value) {
return
}
if (!value) return

const profilePath = resolve(process.cwd(), untildify(value))

Expand Down Expand Up @@ -61,9 +59,7 @@ function mode (value, argv) {
}

function include (value, argv) {
if (!value) {
return
}
if (!value) return

if (value.includes('all')) {
argv.include = modesList
Expand Down Expand Up @@ -175,9 +171,7 @@ function icon (value, argv) {
}

function background (value, argv) {
if (!value) {
return
}
if (!value) return

argv.background = resolve(appDir, untildify(value))

Expand Down

0 comments on commit 0590595

Please sign in to comment.