Skip to content

Commit

Permalink
Extension Config can now take absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Egeberg Hansen committed Oct 18, 2023
1 parent f2014ef commit f592429
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 22 deletions.
Binary file modified build/distributions/cobol-check-0.2.8.zip
Binary file not shown.
10 changes: 0 additions & 10 deletions scripts/linux_gnucobol_run_tests

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/windows_gnucobol_run_tests.cmd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ private static String getCorrectRunContext(String path){
if (path.startsWith(".") && path.length() > 0){
path = path.substring(1);
}
if (path.length() > 0 && (path.startsWith("/") || path.substring(1,3).equals(":\\") || path.substring(1,3).equals(":/"))){
return StringHelper.adjustPathString(path);
}
return StringHelper.adjustPathString(PathHelper.endWithFileSeparator(runDirectory) + path);
}
return StringHelper.adjustPathString(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FileNameMatcher extends SimpleFileVisitor<Path> {
private boolean defaultToAllFiles = false;

public FileNameMatcher(String pattern) {
if (pattern.length() == 0) {
if (pattern.length() == 0 || pattern.equals("null")) {
defaultToAllFiles = true;
}
matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern);
Expand Down
6 changes: 5 additions & 1 deletion vs-code-extension/Cobol-check/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ cobolcheck.decimalPointIsComma = false
cobolcheck.append.rules = null

#---------------------------------------------------------------------------------------------------------------------
# Path for the generated Cobol test code
# Path for the generated Cobol test code and the executeable file
# On Linux begin the path with a / to make it absolute and an x:\\ or x:/ to do he same on Windows.
# Default: ./
#---------------------------------------------------------------------------------------------------------------------
# cobolcheck.test.program.path = /home/myName/temp
# cobolcheck.test.program.path = c:\\Developer\\temp
# cobolcheck.test.program.path = c:/Developer/temp
cobolcheck.test.program.path = Cobol-check

#---------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#
# GnuCOBOL 2.2 or later is installed and on the path. Its executable or alias or symlink is named "cobc".

cd "$(dirname $1)"
cobc -x $@
name=$(echo "$1" | cut -f 1 -d '.')
"${name}"
"${name}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ rem
rem Assumptions:
rem
rem GnuCOBOL 3.+ is installed and on the path. Its executable or alias or symlink is named "cobc".

cobc -x %* && %~n1
%~d1
cd %~p1
cobc -x %*
%~n1

0 comments on commit f592429

Please sign in to comment.