Use connectr.ini.in as config template.
name = "connectr"
version = "0.0.1"
authors = [ "Trevor Bentley <trevor@trevorbentley.com>" ]
+build = "build.rs"
[dependencies]
curl = "0.4.6"
+use std::fs;
+use std::path::Path;
+fn main() {
+ // Copy connectr.ini.in to connectr.ini if connectr.ini does not exist.
+ //
+ // The local changes in connectr.ini are always preserved, so you can
+ // set private keys without worrying about git.
+ let ini_file = Path::new("connectr.ini");
+ if !ini_file.exists() {
+ let _ = fs::copy("connectr.ini.in", "connectr.ini");
+ }
+
+ // Try again on re-build if either INI file has changed.
+ println!("cargo:rerun-if-changed=connectr.ini");
+ println!("cargo:rerun-if-changed=connectr.ini.in");
+}
-[connectr]
-port = 5432
-
-[application]
-client_id = <SPOTIFY_CLIENT_ID>
-secret = <SPOTIFY_CLIENT_SECRET>
+[connectr]
+port = 5432
+
+[application]
+client_id = <SPOTIFY_CLIENT_ID>
+secret = <SPOTIFY_CLIENT_SECRET>