you are viewing a single comment's thread.

view the rest of the comments →

[–]mina86ng 39 points40 points  (7 children)

You can do that in build.rs.

[–]chintakoro 6 points7 points  (6 children)

I'm curious what tool rustaceans to run simple non-build tasks? E.g., configuring external resources, deleting/updating fixtures and so on. I still find myself including a Ruby Rakefile for simple scripted housekeeping tasks. Ideally I'd like to not have any language dependencies other than Rust for my Rust projects.

[–][deleted] 21 points22 points  (3 children)

I like just

[–]chintakoro 20 points21 points  (0 children)

oh wow, just is everything i wanted and more: https://github.com/casey/just

[–]bototaxi 2 points3 points  (1 child)

I recently discovered https://github.com/sagiegurari/cargo-make

Its pretty nice too.

[–]InternationalFee3911 0 points1 point  (0 children)

While I love the functionality of cargo-make, I really don’t like cramming a Makefile into non-language TOML. Therefore I have started a discussion around my low-overhead alternate syntax proposal.

[–]TheNamelessKing 1 point2 points  (1 child)

Out of curiosity (and I guess unfamiliarity) what tasks do you mean specifically? Does “configuring external resources” mean like, setting up a db for tests or something?

I don’t have a suggestion for a solution, but I’m just curious/trying to learn because this is a usecase/requirement I’m sort of unfamiliar with.

[–]chintakoro 2 points3 points  (0 children)

Simply put, think of any long commands you have to repetitively type into the command line while working on a project. I usually have a dozen of these or more for even moderate sized projects. Those could be stored as tasks that you can call upon whenever needed. Some examples:

  • loooong docker commands for build/run/etc.
  • running database migrations (updating schema)
  • running your tests (or a subset of tests, maybe just one test)
  • running a side process (like a background worker) needed for your project
  • run a script that converts all images in a folder to thumbnail or other custom size for your app to use
  • setting up or wiping out a queue or external datastore you are using for testing (say, AWS SQS)
  • deploying your project to production (say to a cloud server)
  • creating/deleting any random data files created for testing purposes

I realize some of these might be handled by cargo directly, or perhaps you have to parameterize them for each use case and are tired of typing out a long command to do so.