Skip to content

Commit 6d2f796

Browse files
committed
Remove docs about --before and --then flags since they are not planned anymore
1 parent fbfb548 commit 6d2f796

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -343,24 +343,6 @@ are ES modules, and you can just `import` them e.g. on Node.
343343
> $ spago build --output myOutput
344344
> ```
345345

346-
To run a command before a build you can use the `--before` flag, eg to post a notification that a build has started:
347-
348-
```console
349-
$ spago build --before "notify-send 'Building'"
350-
```
351-
352-
To run a command after the build, use `--then` for successful builds, or `--else` for unsuccessful builds:
353-
354-
```console
355-
$ spago build --then "notify-send 'Built successfully'" --else "notify-send 'Build failed'"
356-
```
357-
358-
Multiple commands are possible - they will be run in the order specified:
359-
360-
```console
361-
$ spago build --before clear --before "notify-send 'Building'"
362-
```
363-
364346
If you want to run the program, just use `run`:
365347

366348
```console

test/Spago/Build.purs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -247,61 +247,3 @@ spec = Spec.around withTempDir do
247247
Monorepo.spec
248248

249249
BuildInfo.spec
250-
251-
-- Spec.it "runs a --before command" \{ spago } -> do
252-
-- spago [ "init" ] >>= shouldBeSuccess
253-
-- let dumpFile = "testOutput"
254-
-- spago [ "build", "--before", "echo before>> " <> dumpFile ] >>= shouldBeSuccess
255-
-- test <- FS.readTextFile dumpFile
256-
-- test `Assert.shouldEqual` "before"
257-
258-
-- Spec.it "runs a --then command" \{ spago } -> do
259-
-- spago [ "init" ] >>= shouldBeSuccess
260-
-- let dumpFile = "testOutput"
261-
-- spago [ "build", "--then", "echo then>> " <> dumpFile, "--else", "echo else>> " <> dumpFile ] >>= shouldBeSuccess
262-
-- test <- FS.readTextFile dumpFile
263-
-- test `Assert.shouldEqual` "then"
264-
265-
-- Spec.it "runs a --before command before a --then command" \{ spago } -> do
266-
-- spago [ "init" ] >>= shouldBeSuccess
267-
-- let dumpFile = "testOutput"
268-
-- spago [ "build", "--before", "echo before>> " <> dumpFile, "--then", "echo then>> " <> dumpFile ] >>= shouldBeSuccess
269-
-- test <- FS.readTextFile dumpFile
270-
-- test `Assert.shouldEqual` "before\nthen"
271-
272-
-- Spec.it "runs an --else command if there is an error in the build" \{ spago } -> do
273-
-- spago [ "init" ] >>= shouldBeSuccess
274-
-- let dumpFile = "testOutput"
275-
-- FS.writeTextFile "src/Main.purs" "Invalid Purescript code"
276-
-- spago [ "build", "--then", "echo then>> " <> dumpFile, "--else", "echo else>> " <> dumpFile ] >>= shouldBeFailure
277-
-- test <- FS.readTextFile dumpFile
278-
-- test `Assert.shouldEqual` "else"
279-
280-
-- Spec.it "runs an --else command if there is an error in the run file" \{ spago } -> do
281-
-- spago [ "init" ] >>= shouldBeSuccess
282-
-- spago [ "install", "exceptions" ] >>= shouldBeSuccess
283-
-- let dumpFile = "testOutput"
284-
-- FS.writeTextFile "src/Main.purs" "module Main where\nimport Effect.Exception\nmain = throw \"error\""
285-
-- spago [ "run", "--else", "echo else>> " <> dumpFile ] >>= shouldBeFailure
286-
-- test <- FS.readTextFile dumpFile
287-
-- test `Assert.shouldEqual` "else"
288-
289-
-- Spec.it "runs multiple commands in order" \{ spago } -> do
290-
-- spago [ "init" ] >>= shouldBeSuccess
291-
-- let dumpFile = "testOutput"
292-
-- spago [ "build", "--before", "echo before1>> " <> dumpFile, "--before", "echo before2>> " <> dumpFile, "--then", "echo then1>> " <> dumpFile, "--then", "echo then2>> " <> dumpFile ] >>= shouldBeSuccess
293-
-- test <- FS.readTextFile dumpFile
294-
-- test `Assert.shouldEqual` "before1\nbefore2\nthen1\nthen2"
295-
296-
-- Spec.it "fails the build if a --before command fails" \{ spago } -> do
297-
-- spago [ "init" ] >>= shouldBeSuccess
298-
-- spago [ "build", "--before", "exit 1" ] >>= shouldBeFailure
299-
300-
-- Spec.it "fails the build if a --then command fails" \{ spago } -> do
301-
-- spago [ "init" ] >>= shouldBeSuccess
302-
-- spago [ "build", "--then", "exit 1" ] >>= shouldBeFailure
303-
304-
-- Spec.it "still fails the build if an --else command fails" \{ spago } -> do
305-
-- spago [ "init" ] >>= shouldBeSuccess
306-
-- FS.writeTextFile "src/Main.purs" "Invalid Purescript code"
307-
-- spago [ "build", "--else", "exit 1" ] >>= shouldBeFailure

0 commit comments

Comments
 (0)