on master help sign in
Fix ob command's autocompleter
commita1db8722691e191163d02cf451dfeec785cc7806 authorMadeline Haraj <min@obsidian.systems> dateMon 8 Oct 2018, 14:09 (8 years ago) parent9c7bb87
2 files changed+16−11
default.nix+15−10 lib/command/src/Obelisk/Command/Project.hs+1−1
default.nix+15−10
@@ -88,7 +88,20 @@ let
8888 obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (hackGet ./lib/asset + "/serve-snap") {};
8989 obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
9090 obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
91− obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {});
91+ obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}).overrideAttrs
92+ (drv: {
93+ buildInputs = drv.buildInputs ++ [ pkgs.makeWrapper ];
94+ postInstall = ''
95+ ${drv.postInstall or ""}
96+ # Install migrations
97+ cp -r ${./migration} $out/migration;
98+ '';
99+ postFixup = ''
100+ ${drv.postFixup or ""}
101+ # Make `ob` reference its runtime dependencies.
102+ wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
103+ '';
104+ });
92105 obelisk-executable-config = executableConfig.haskellPackage self;
93106 obelisk-executable-config-inject = executableConfig.platforms.web.inject self;
94107 obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
@@ -111,15 +124,7 @@ rec {
111124 pathGit = ./.; # Used in CI by the migration graph hash algorithm to correctly ignore files.
112125 path = reflex-platform.filterGit ./.;
113126 obelisk = ghcObelisk;
114− commandWithMigration = ghcObelisk.obelisk-command.overrideAttrs (drv: {
115− postInstall = (drv.postInstall or "") +
116− ''cp -r ${./migration} $out/migration;'';
117− });
118− command = pkgs.runCommand commandWithMigration.name { nativeBuildInputs = [pkgs.makeWrapper]; } ''
119− mkdir -p "$out/bin"
120− ln -s '${commandWithMigration}/bin/ob' "$out/bin/ob"
121− wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
122− '';
127+ command = ghcObelisk.obelisk-command;
123128 shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs) [];
124129
125130 selftest = pkgs.writeScript "selftest" ''
lib/command/src/Obelisk/Command/Project.hs+1−1
@@ -110,7 +110,7 @@ initProject source = withSystemTempDirectory "ob-init" $ \tmpDir -> do
110110--TODO: Allow the user to ignore our security concerns
111111-- | Find the Obelisk implementation for the project at the given path
112112findProjectObeliskCommand :: MonadObelisk m => FilePath -> m (Maybe FilePath)
113−findProjectObeliskCommand target = withSpinnerNoTrail "Locating project obelisk" $ do
113+findProjectObeliskCommand target = do
114114 myUid <- liftIO getRealUserID
115115 targetStat <- liftIO $ getFileStatus target
116116 (result, insecurePaths) <- flip runStateT [] $ walkToProjectRoot target targetStat myUid >>= \case