forked from Youssef1313/ChessSharp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic extraction of version from csproj, refactoring, better auto…
…matic naming of sets, automatic download of BIG puzzle csv file.
- Loading branch information
Showing
6 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file extracts and prints the VersionPrefix from a csproj file. | ||
# Must be called like this: tclsh extract-vers.tcl xyz.csproj | ||
|
||
proc readLines { fileName error } { | ||
upvar $error err | ||
if { [file exists $fileName] == 0 } { | ||
set err ERR_FILE_NOT_FOUND | ||
return 0 | ||
} | ||
set f [open $fileName] | ||
set lineList [read $f] | ||
close $f | ||
set ll [split $lineList \n] | ||
set ll [lreplace $ll end end] | ||
return $ll | ||
} | ||
|
||
proc getValueFromKey {lines key default} { | ||
upvar $lines ll | ||
foreach line $ll { | ||
#puts "getValueFromIniLines 1.1 line=$line" | ||
if { [regexp "<$key>(.*)</$key>" $line r r1] !=0 } { | ||
#puts "getValueFromIniLines 1.2" | ||
return $r1 | ||
} | ||
} | ||
return $default | ||
} | ||
|
||
set filename [lindex $argv 0] | ||
#puts "LOOKING FOR VERS in $filename" | ||
set err {} | ||
set ll [readLines $filename err] | ||
#puts LL=$ll | ||
set vers [getValueFromKey ll {VersionPrefix} {0}] | ||
puts $vers |
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
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
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
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