on master help sign in
do not support the ability to ob thunk set unpacked thunks
commitfe4de3b77ae913387a4ad973957e3c9ca66c210e authorhsloan <ishaqsloan@gmail.com> dateWed 28 Nov 2018, 19:28 (8 years ago) parent1c0e71d
2 files changed+2−7
lib/command/src/Obelisk/Command/Thunk.hs+2−4 lib/selftest/src/Obelisk/SelfTest.hs−3
lib/command/src/Obelisk/Command/Thunk.hs+2−4
@@ -639,6 +639,7 @@ setThunk' noTrail branch thunkDir = checkThunkDirectory thunkDir >> readThunk th
639639 (exitCode, _) <- gitLsRemoteExitCode repository branch
640640 case exitCode of
641641 ExitSuccess -> do
642+ -- TODO: Accomplish this without unpacking
642643 _ <- unpackThunk' noTrail thunkDir
643644 callProcessAndLogOutput (Debug, Error) $ gitProc thunkDir ["checkout", branch]
644645 _ <- packThunk' noTrail thunkDir
@@ -646,10 +647,7 @@ setThunk' noTrail branch thunkDir = checkThunkDirectory thunkDir >> readThunk th
646647 ExitFailure errNum -> failWith $ T.pack $ if errNum == 2
647648 then "Error: branch not found"
648649 else ("Error Code: " <> show errNum <> "issue checking out the desired branch")
649− Right (ThunkData_Checkout _) -> do
650− callProcessAndLogOutput (Debug, Error) $ gitProc thunkDir ["checkout", branch]
651− _ <- packThunk' noTrail thunkDir
652− updateThunkToLatest thunkDir
650+ Right (ThunkData_Checkout _) -> failWith $ T.pack $ "thunk located at " <> (show thunkDir) <> " is unpacked. Use ob thunk pack on the desired directory and then try ob thunk set again."
653651
654652getThunkPtr :: MonadObelisk m => FilePath -> m ThunkPtr
655653getThunkPtr = getThunkPtr' True
lib/selftest/src/Obelisk/SelfTest.hs−3
@@ -220,9 +220,6 @@ main = do
220220 run_ "ob" ["thunk", "pack", toTextIgnore dir]
221221 run_ "ob" ["thunk", "set", toTextIgnore dir, "--branch", branch]
222222
223− it "can set an unpacked thunk to another packed thunk" $ withTmp $ \dir -> do
224− run_ "git" ["clone", "https://github.com/reflex-frp/reflex.git", toTextIgnore dir, "--branch", "cg-quickref"]
225− run_ "ob" ["thunk", "set", toTextIgnore dir, "--branch", branch]
226223
227224-- | Run `ob run` in the given directory (maximum of one level deep)
228225testObRunInDir :: Socket.PortNumber -> Socket.PortNumber -> Maybe Shelly.FilePath -> HTTP.Manager -> Sh ()