use proper paths in game's colorscheme-scraping build script, so things work on windows. should fix #33. try re-enabling windows build to confirm. [rebuild]

This commit is contained in:
Dustin Carlino 2019-12-26 17:52:25 -06:00
parent 38bc88d54b
commit 227c20bd38
2 changed files with 20 additions and 18 deletions

View File

@ -1,21 +1,21 @@
name: Build
on: [push]
jobs:
# TODO The build.rs in game fails for Windows. My guess is the $OUT_DIR env var isn't there.
# build-windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@master
# - uses: hecrj/setup-rust-action@v1
# with:
# rust-version: 1.40.0
# - name: Run build
# run: cargo build --release --bin game
# - name: Upload binary
# uses: actions/upload-artifact@v1
# with:
# name: game_windows.exe
# path: target/release/game.exe
build-windows:
runs-on: windows-latest
if: "contains(github.event.head_commit.message, '[rebuild]')"
steps:
- uses: actions/checkout@master
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.40.0
- name: Run build
run: cargo build --release --bin game
- name: Upload binary
uses: actions/upload-artifact@v1
with:
name: game_windows.exe
path: target/release/game.exe
build-macos:
runs-on: macos-latest
if: "contains(github.event.head_commit.message, '[rebuild]')"

View File

@ -1,16 +1,18 @@
use std::collections::BTreeMap;
use std::env;
use std::ffi::OsStr;
use std::fs::File;
use std::io::{Read, Write};
use std::path::PathBuf;
use walkdir::WalkDir;
// TODO See https://github.com/dtolnay/inventory for an alternate approach.
fn main() {
let mut mapping: BTreeMap<String, String> = BTreeMap::new();
for entry in WalkDir::new("src") {
let path = format!("{}", entry.unwrap().into_path().display());
if path.ends_with(".rs") && path != "src/helpers.rs" {
for (k, v) in read_file(&path) {
let path = entry.unwrap().into_path();
if path.extension() == Some(OsStr::new("rs")) && path != PathBuf::from("src/helpers.rs") {
for (k, v) in read_file(&format!("{}", path.display())) {
if mapping.contains_key(&k) {
panic!("Color {} defined twice", k);
}