Merge pull request #239948 from Strum355/tree-sitter-playground

tree-sitter: fix webui/playground notice & terminating
This commit is contained in:
Nick Cao 2023-06-29 12:50:25 +08:00 committed by GitHub
commit d5d9df6642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,16 +2,9 @@
, stdenv
, fetchgit
, fetchFromGitHub
, fetchurl
, writeShellScript
, runCommand
, which
, formats
, rustPlatform
, jq
, nix-prefetch-git
, xe
, curl
, emscripten
, Security
, callPackage
@ -120,10 +113,10 @@ rustPlatform.buildRustPackage {
postPatch = lib.optionalString (!webUISupport) ''
# remove web interface
sed -e '/pub mod web_ui/d' \
sed -e '/pub mod playground/d' \
-i cli/src/lib.rs
sed -e 's/web_ui,//' \
-e 's/web_ui::serve(&current_dir.*$/println!("ERROR: web-ui is not available in this nixpkgs build; enable the webUISupport"); std::process::exit(1);/' \
sed -e 's/playground,//' \
-e 's/playground::serve(&current_dir.*$/println!("ERROR: web-ui is not available in this nixpkgs build; enable the webUISupport"); std::process::exit(1);/' \
-i cli/src/main.rs
'';