Skip to content

Commit 1af3e35

Browse files
authored
Merge pull request #24 from rfuzzo/fix/omwscripts
forgot omwscripts
2 parents bd66284 + 9bb4661 commit 1af3e35

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

src/expressions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl Display for NOT {
280280
////////////////////////////////////////////////////////////////////////
281281
// DESC
282282

283-
/// TODO The Desc predicate is a special predicate that matches strings in the header of a plugin with regular expressions.
283+
/// The Desc predicate is a special predicate that matches strings in the header of a plugin with regular expressions.
284284
/// [DESC /regex/ A.esp] or [DESC !/regex/ A.esp]
285285
#[derive(Debug, Serialize, Deserialize)]
286286
pub struct DESC {

src/lib.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -309,23 +309,27 @@ where
309309
description: None,
310310
version: None,
311311
};
312-
match parse_header(f) {
313-
Ok(header) => {
314-
data.description = Some(header.description);
315-
316-
// parse semver
317-
let version = header.version.to_string();
318-
match lenient_semver::parse(&version) {
319-
Ok(v) => {
320-
data.version = Some(v);
321-
}
322-
Err(e) => {
323-
log::debug!("Error parsing version: {}", e);
312+
313+
// skip if extension is omwscripts
314+
if !file_name.to_ascii_lowercase().ends_with("omwscripts") {
315+
match parse_header(f) {
316+
Ok(header) => {
317+
data.description = Some(header.description);
318+
319+
// parse semver
320+
let version = header.version.to_string();
321+
match lenient_semver::parse(&version) {
322+
Ok(v) => {
323+
data.version = Some(v);
324+
}
325+
Err(e) => {
326+
log::debug!("Error parsing version: {}", e);
327+
}
324328
}
325329
}
326-
}
327-
Err(e) => {
328-
log::debug!("Error parsing header: {}, {}", e, f.display());
330+
Err(e) => {
331+
log::debug!("Error parsing header: {}, {}", e, f.display());
332+
}
329333
}
330334
}
331335

src/parser.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ pub fn new_tes3_parser() -> Parser {
3030

3131
pub fn new_openmw_parser() -> Parser {
3232
Parser::new(
33-
vec![".esp".into(), ".esm".into(), ".omwaddon".into()],
33+
vec![
34+
".esp".into(),
35+
".esm".into(),
36+
".omwaddon".into(),
37+
".omwscripts".into(),
38+
],
3439
ESupportedGame::OpenMW,
3540
)
3641
}

0 commit comments

Comments
 (0)