File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
ghcjs/delivery-calculator Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 99 label = def . label ;
1010 pkgs = inputs . ghc-wasm-meta . inputs . nixpkgs . legacyPackages . ${ system } ;
1111 shell = import ./../../nix/shell.nix ;
12+ safeCopy = "cp -RL --no-preserve=mode,ownership" ;
13+ forceCopy = "cp -RLf --no-preserve=mode,ownership" ;
1214 app-ghcid = pkgs . writeScriptBin "app-ghcid" ''
1315 ${ pkgs . ghcid } /bin/ghcid --test="Main.main" --command="${ pkgs . cabal-install } /bin/cabal new-repl ${ label } --disable-optimization --repl-options=-fobject-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j -fghcid"
1416 '' ;
4850 out="./dist/latest"
4951 rm -rf "$out"
5052 mkdir -p "$out/static"
51- cp -RLf --no-preserve=mode,ownership ${ ../miso-functora/dist } /* $out/
53+ ${ forceCopy } ${ ../miso-functora/dist } /* $out/
5254 cp ./static/*.png $out/static/
5355 cp ./static/*.webmanifest $out/
5456 cp ./static/*.ico $out/
101103 nix-shell ./android.nix --command "app-release-aab"
102104 '' ;
103105 } ;
106+ app-release-web = pkgs . writeShellApplication rec {
107+ name = "app-release-web" ;
108+ text = ''
109+ (
110+ ${ app-release-latest } /bin/app-release-latest
111+ if [ -d "./../../apps/${ label } /${ vsn } " ]
112+ then
113+ echo "Version ${ vsn } does already exist!"
114+ exit 1
115+ else
116+ mkdir -p ./../../apps/${ label } /${ vsn }
117+ fi
118+ ${ safeCopy } ./dist/latest/* ./../../apps/${ label } /${ vsn }
119+ echo '<!doctype html><html><head><meta http-equiv="Refresh" content="0; url=${ vsn } /index.html"></head><body></body></html>' > ./../../apps/${ label } /index.html
120+ )
121+ '' ;
122+ } ;
104123 in {
105124 devShells . default = pkgs . mkShell {
106125 packages =
119138 app-release-latest
120139 app-release-apk
121140 app-release-aab
141+ app-release-web
122142 ]
123143 ++ ( import ../../nix/tools.nix ) ;
124144 } ;
You can’t perform that action at this time.
0 commit comments