Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active August 29, 2015 14:12
Show Gist options
  • Save Integralist/12b3f1370dbc1530ad0b to your computer and use it in GitHub Desktop.
Save Integralist/12b3f1370dbc1530ad0b to your computer and use it in GitHub Desktop.
Rust Cargo Guardfile
require "terminal-notifier-guard"
guard :shell do
watch(/src\/(.*\/)?(.*)\.rs$/) do |path, folder, file|
p "Path: #{path}"
p "Folder: #{folder}"
p "File: #{file}"
binary_name = `sed -ne 's/name = "\\(.*\\)"/\\1/p' Cargo.toml | tail -n 1`
`cargo build && ./target/#{binary_name}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment