Reputation: 10707
I am playing with sbt, and I would like to export the last few commands into a file.
I can get history of commands with !:
, so is it possible to have something like
!: >> output.txt
?
Upvotes: 2
Views: 1183
Reputation: 1006
You have it already stored in a file. For more details you can check: http://www.scala-sbt.org/0.12.3/docs/Howto/interactive.html
By default, interactive history is stored in the target/ directory for the current project (but is not removed by a clean). History is thus separate for each sub-project. The location can be changed with the historyPath setting, which has type Option[File]. For example, history can be stored in the root directory for the project instead of the output directory:
historyPath <<= baseDirectory(t => Some(t / ".history"))
The history path needs to be set for each project, since sbt will use the value of historyPath for the current project (as selected by the project command).
Upvotes: 4
Reputation: 4798
You can just copy your history file, from which these last lines are taken upon !
call or take a look at https://github.com/steppenwells/sbt-sh, which allows you to interact with shell intuitively.
Upvotes: 2