diff --git a/.editorconfig b/.editorconfig index 5dfd8f5..58692bf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -29,9 +29,6 @@ indent_size = 2 trim_trailing_whitespace = false insert_final_newline = false -[/version.txt] -insert_final_newline = false - [/src/content/themes/*/index.php] indent_style = space indent_size = 2 diff --git a/buildzip.php b/buildzip.php index 59b4713..ba84917 100755 --- a/buildzip.php +++ b/buildzip.php @@ -31,12 +31,9 @@ if (!is_dir($dir)) { print "> Repository was cloned to temp dir: $dir\n"; #get current version number if not specified -if (!$ver) -{ - chdir($dir); - $fh = fopen('version.txt', 'r') or die("Cant open version.txt\n"); - $ver = trim(fgets($fh, 100)); - fclose($fh); +if (!$ver) { + require_once(__DIR__ . '/src/includes/version.php'); + $ver = mytinytodo\Version::VERSION; } chdir($dir. DIRECTORY_SEPARATOR. 'src'); $rev = trim(`git show --format=format:%H --summary`); @@ -52,10 +49,6 @@ fwrite($fh, "\n"); fclose($fh); */ -#replace @VERSION -replaceVer('./setup.php', $ver); -replaceVer('./init.php', $ver); - unlink('./docker-config.php'); unlink('./content/lang/en-rtl.json'); /* @@ -111,10 +104,3 @@ function deleteTreeIfDir($dir) } } } - -function replaceVer($filename, $ver) -{ - $s = @file_get_contents($filename) or die("Cant open $filename\n"); - $s = str_replace('@VERSION', $ver, $s); - @file_put_contents($filename, $s) or die("Cant write $filename\n"); -} \ No newline at end of file diff --git a/src/includes/version.php b/src/includes/version.php new file mode 100644 index 0000000..e35581c --- /dev/null +++ b/src/includes/version.php @@ -0,0 +1,8 @@ +