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 9
9
label = def . label ;
10
10
pkgs = inputs . ghc-wasm-meta . inputs . nixpkgs . legacyPackages . ${ system } ;
11
11
shell = import ./../../nix/shell.nix ;
12
+ safeCopy = "cp -RL --no-preserve=mode,ownership" ;
13
+ forceCopy = "cp -RLf --no-preserve=mode,ownership" ;
12
14
app-ghcid = pkgs . writeScriptBin "app-ghcid" ''
13
15
${ 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"
14
16
'' ;
48
50
out="./dist/latest"
49
51
rm -rf "$out"
50
52
mkdir -p "$out/static"
51
- cp -RLf --no-preserve=mode,ownership ${ ../miso-functora/dist } /* $out/
53
+ ${ forceCopy } ${ ../miso-functora/dist } /* $out/
52
54
cp ./static/*.png $out/static/
53
55
cp ./static/*.webmanifest $out/
54
56
cp ./static/*.ico $out/
101
103
nix-shell ./android.nix --command "app-release-aab"
102
104
'' ;
103
105
} ;
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
+ } ;
104
123
in {
105
124
devShells . default = pkgs . mkShell {
106
125
packages =
119
138
app-release-latest
120
139
app-release-apk
121
140
app-release-aab
141
+ app-release-web
122
142
]
123
143
++ ( import ../../nix/tools.nix ) ;
124
144
} ;
You can’t perform that action at this time.
0 commit comments