Skip to content
Snippets Groups Projects
Select Git revision
  • 444657bb1661f6f00d7c2b226a5161d834d71cdd
  • master default protected
  • 1.31
  • 4.38.6
  • 4.38.5
  • 4.38.4
  • 4.38.3
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
  • 4.32.0
  • 4.31.0
23 results

build-stylesheets.nix

Blame
  • build-stylesheets.nix 1.05 KiB
    {pkgs', ...}: let
    in
      pkgs'.writeShellScriptBin "build-stylesheets" ''
        source ${pkgs'.common}/bin/common
    
        echo_section "Building stylesheets"
        echo_hint "The command is executed in the current working directory and not in a nix derivation."
        cd_working_dir
    
        sourcePath="$(pwd)/source"
    
        function build() {
            source ${pkgs'.common}/bin/common
            local prefix="''${sourcePath}/"
            echo_step "build stylesheet ''${1#$prefix}"
            ${pkgs'.nodejs_20}/bin/node ./development/scripts/buildStylesheets.mjs "$1"
        }
    
        export -f build
    
        if ! ${pkgs'.fd}/bin/fd --absolute-path --full-path "$sourcePath" --type file --extension pcss --exclude '/mixin/' -0 | xargs -0 -I {} bash -c 'build "$@"' _ {}; then
          echo_fail "Stylesheet build failed. Exiting."
          exit 1
        fi
        
        echo_step "Formatting JS code"
        if ! ${pkgs'.biome}/bin/biome format --write ./source/
        then
          echo_fail "biome format failed"
          exit 1
        else
            echo_ok "JS code formatted"
        fi
    
        echo_ok "Stylesheet build successful"
      ''