<?php

$fileName = "./config.json";

$string = file_get_contents($fileName);
$json = json_decode($string, TRUE);

$newVersion = trim(shell_exec("git describe --tags | head"));

$json["version"] = $newVersion;

//print_r($json);

$newConfig = json_encode($json, JSON_PRETTY_PRINT);

file_put_contents($fileName, $newConfig);
