Add dependency install info to overview

This commit is contained in:
Christoph Hagen 2023-02-01 20:27:11 +01:00
parent 6b32f37fd9
commit 89245f2553

View File

@ -21,7 +21,7 @@ private func checkImageOptimAvailability() -> Bool {
if version.count > 1 { if version.count > 1 {
print(" ImageOptim: \(version.map { "\($0)" }.joined(separator: "."))") print(" ImageOptim: \(version.map { "\($0)" }.joined(separator: "."))")
} else { } else {
print(" ImageOptim: Not found") print(" ImageOptim: Not found, download app from https://imageoptim.com/mac and install using 'npm install imageoptim-cli'")
return false return false
} }
} catch { } catch {
@ -36,7 +36,7 @@ private func checkMagickAvailability() -> Bool {
let output = try safeShell("magick --version") let output = try safeShell("magick --version")
guard let version = output.components(separatedBy: "ImageMagick ").dropFirst().first? guard let version = output.components(separatedBy: "ImageMagick ").dropFirst().first?
.components(separatedBy: " ").first else { .components(separatedBy: " ").first else {
print(" Magick: Not found") print(" Magick: Not found, install using 'brew install imagemagick'")
return false return false
} }
print(" Magick: \(version)") print(" Magick: \(version)")
@ -54,7 +54,7 @@ private func checkCwebpAvailability() -> Bool {
if version.count > 1 { if version.count > 1 {
print(" cwebp: \(version.map { "\($0)" }.joined(separator: "."))") print(" cwebp: \(version.map { "\($0)" }.joined(separator: "."))")
} else { } else {
print(" cwebp: Not found") print(" cwebp: Not found, download from https://developers.google.com/speed/webp/download")
return false return false
} }
} catch { } catch {
@ -71,7 +71,7 @@ private func checkAvifAvailability() -> Bool {
if version.count > 1 { if version.count > 1 {
print(" avif: \(version.map { "\($0)" }.joined(separator: "."))") print(" avif: \(version.map { "\($0)" }.joined(separator: "."))")
} else { } else {
print(" avif: Not found") print(" avif: Not found, install using 'npm install avif'")
return false return false
} }
} catch { } catch {
@ -90,7 +90,7 @@ private func checkUglifyJsAvailability() -> Bool {
print(" uglify-js: \(version.map { "\($0)" }.joined(separator: "."))") print(" uglify-js: \(version.map { "\($0)" }.joined(separator: "."))")
} else { } else {
print("'\(output)'") print("'\(output)'")
print(" uglify-js: Not found") print(" uglify-js: Not found, install using 'npm install uglify-js'")
return false return false
} }
} catch { } catch {
@ -108,7 +108,7 @@ private func checkCleanCssAvailability() -> Bool {
if version.count > 1 { if version.count > 1 {
print(" cleancss: \(version.map { "\($0)" }.joined(separator: "."))") print(" cleancss: \(version.map { "\($0)" }.joined(separator: "."))")
} else { } else {
print(" cleancss: Not found") print(" cleancss: Not found, install using 'npm install clean-css-cli'")
return false return false
} }
} catch { } catch {