Compare commits

...

2 Commits

Author SHA1 Message Date
Christoph Hagen
89245f2553 Add dependency install info to overview 2023-02-01 20:27:11 +01:00
Christoph Hagen
6b32f37fd9 Add missing dependencies to install script 2023-02-01 20:26:56 +01:00
2 changed files with 12 additions and 6 deletions

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 {

View File

@ -1,6 +1,12 @@
#!/bin/bash #!/bin/bash
# Install the required dependencies for CHGenerator # Install the required dependencies for CHGenerator
# Install magick to resize images
brew install imagemagick
# Install avif to create AVIF versions of images
npm install avif -g
# Install the Javascript minifier (required if `minifyJavaScript = True`) # Install the Javascript minifier (required if `minifyJavaScript = True`)
# https://github.com/mishoo/UglifyJS # https://github.com/mishoo/UglifyJS
npm install uglify-js -g npm install uglify-js -g