Ini file insert a lot of spaces

Is only a visual detail, but maybe easy to fix.

rootFolderGIT = "c:/Program Files/GIT/bin/git.exe";
rootFolderGITParams = "rev-parse --verify HEAD" ;

commit_app = shell.exec(rootFolderGIT, rootFolderGITParams, {capture : "true"} );

shell.cd(path_sourcecore);
commit_core = shell.exec(rootFolderGIT, rootFolderGITParams, {capture : "true"} );

release_ini = ini.fromFile(path_basetmp + "\\" + file_release_info);
release_ini.setValue("config", "commit_core", commit_core);
release_ini.setValue("config", "commit_app", commit_app);
release_ini.toFile(path_basetmp + "\\" + file_release_info);

Cause that line break an lot of spaces in the ini file

[config]
build=1090
release=314
commit_core=d8c2ce09c431eb64c7c10382ae8579daefc3d405


commit_app=7b523ddbf714a2d6b9e615e0828ba180d047461e


version=20.6.314.1090

As the file is distributed with release i hope can be fixed.

Best regards.

Sure you doubt have line breaks in “commit_core” and “commit_app”?

Right, is possible GIT returns lines break and spaces. Theres any way to remove extra chars one Train?

Best regards.

yeah, just call trim()on the string:

release_ini.setValue("config", "commit_core", commit_core.trim());
release_ini.setValue("config", "commit_app", commit_app.trim());
1 Like