Unverified Commit 66c759bd authored by isabel's avatar isabel
Browse files

vscode-utils.buildVscodeExtension: support alternative installPhase and sourceRoot

parent dd659174
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ let
        nativeBuildInputs ? [ ],
        passthru ? { },
        ...
      }:
      }@args:
      {
        pname = "vscode-extension-${pname}";

@@ -53,14 +53,15 @@ let

        # Some .vsix files contain other directories (e.g., `package`) that we don't use.
        # If other directories are present but `sourceRoot` is unset, the unpacker phase fails.
        sourceRoot = "extension";
        sourceRoot = args.sourceRoot or "extension";

        # This cannot be removed, it is used by some extensions.
        installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}";

        nativeBuildInputs = [ unzip ] ++ nativeBuildInputs;

        installPhase = ''
        installPhase =
          args.installPhase or ''
            runHook preInstall

            mkdir -p "$out/$installPrefix"