Fix build for macOS and Fix autoload for uppercase directories

This commit is contained in:
weryques 2018-01-22 09:48:51 -02:00
parent 856ea0b4a7
commit f91d19abbb
3 changed files with 15 additions and 2 deletions

View File

@ -4,7 +4,15 @@ source build-config.cfg
## Only run npm build if there was a change in a .js or .vue file
current_md5=$(<last-js-build.md5)
find src -type f \( -name "*.js" -or -name "*.vue" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
current_OS=`uname`
# For macOS (Darwin)
if [ $current_OS == "Darwin" ]; then
find src -type f \( -name "*.js" -or -name "*.vue" \) -exec md5 {} \; | sort -k 2 | md5 > last-js-build.md5
else
find src -type f \( -name "*.js" -or -name "*.vue" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
fi
new_md5=$(<last-js-build.md5)
if [ "$current_md5" != "$new_md5" ]
then

View File

@ -40,7 +40,11 @@ function tainacan_autoload($class_name){
}
}
elseif ($class_path[0] == 'Tainacan') {
$dir = strtolower(CLASSES_DIR.implode(DIRECTORY_SEPARATOR, array_slice($class_path, 1, count($class_path) -2) )).'/';
$sliced = array_slice($class_path, 1, count($class_path) -2);
$lower = $sliced[0];
$sliced[0] = strtolower($lower);
$dir = CLASSES_DIR.implode(DIRECTORY_SEPARATOR, $sliced ) . '/';
$dir = str_replace('_', '-', $dir);
if( in_array('Field_Types', $class_path) ){

View File

@ -200,6 +200,7 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
$data = $response->get_data();
$this->assertEquals($metadata->get_id(), $data['id']);
$this->assertEquals('Dia/Mês/Ano', $data['name']);
// Mantém-se o valor antigo no item
$metav = get_post_meta($item->get_id(), $data['id'], true);