Skip to content

Commit

Permalink
Merge pull request #189 from pop-os/104
Browse files Browse the repository at this point in the history
Fix for legacy layout for 0.7.104
  • Loading branch information
leviport authored Jun 6, 2023
2 parents d522f5f + 1b8c43e commit 450a14a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions backend/src/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ impl Layout {
}

pub fn from_board(board: &str, version: &str) -> Option<Self> {
let use_legacy_scancodes = version.contains("0.7.103") || version.contains("0.12.20");
let use_legacy_scancodes = version.contains("0.7.103")
|| version.contains("0.7.104")
|| version.contains("0.12.20");
layout_data(board, use_legacy_scancodes).map(
|(meta_json, default_json, keymap_json, layout_json, leds_json, physical_json)| {
Self::from_data(
Expand Down Expand Up @@ -220,7 +222,7 @@ mod tests {
use super::*;
use std::{collections::HashSet, fs, io};

const VERSIONS: [&str; 2] = ["0.7.103", "0.19.12"];
const VERSIONS: [&str; 3] = ["0.7.103", "0.7.104", "0.19.12"];

#[test]
fn layout_from_board() {
Expand Down
2 changes: 1 addition & 1 deletion layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def extract_scancodes(ecdir: str, board: str, is_qmk: bool, has_brightness: bool
is_old_qmk = False
if is_qmk:
version = subprocess.check_output(["git", "-C", ecdir, "describe", "--tags"], stderr=subprocess.DEVNULL, universal_newlines=True)
is_old_qmk = "0.7.103" in version or "0.12.20" in version
is_old_qmk = "0.7.103" in version or "0.7.104" in version or "0.12.20" in version
if is_old_qmk:
include_paths = [f"{ecdir}/tmk_core/common/keycode.h", f"{ecdir}/quantum/quantum_keycodes.h", f"{ecdir}/tmk_core/common/action_code.h"]
includes = [read_stripping_includes(i) for i in include_paths]
Expand Down

0 comments on commit 450a14a

Please sign in to comment.