Last active
August 29, 2015 14:12
-
-
Save Integralist/12b3f1370dbc1530ad0b to your computer and use it in GitHub Desktop.
Rust Cargo Guardfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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