diff --git a/scripts/_future.sh b/scripts/_future.sh index 26b6486..35de3f1 100644 --- a/scripts/_future.sh +++ b/scripts/_future.sh @@ -45,52 +45,7 @@ abort_if_up_to_date () { fi } -ynh_cron_upgrade_node () { - # Build the update script - cat > "$n_install_dir/node_update.sh" << EOF -#!/bin/bash -version_path="$node_version_path" -n_install_dir="$n_install_dir" - -# Log the date -date - -# List all real installed version of node -all_real_version="\$(find \$version_path/* -maxdepth 0 -type d | sed "s@\$version_path/@@g")" - -# Keep only the major version number of each line -all_real_version=\$(echo "\$all_real_version" | sed 's/\..*\$//') - -# Remove double entries -all_real_version=\$(echo "\$all_real_version" | sort --unique) - -# Read each major version -while read version -do - echo "Update of the version \$version" - sudo \$n_install_dir/bin/n \$version - - # Find the last "real" version for this major version of node. - real_nodejs_version=\$(find \$version_path/\$version* -maxdepth 0 | sort --version-sort | tail --lines=1) - real_nodejs_version=\$(basename \$real_nodejs_version) - - # Update the symbolic link for this version - sudo ln --symbolic --force --no-target-directory \$version_path/\$real_nodejs_version \$version_path/\$version -done <<< "\$(echo "\$all_real_version")" -EOF - - chmod +x "$n_install_dir/node_update.sh" - - # Build the cronjob - cat > "/etc/cron.daily/node_update" << EOF -#!/bin/bash - -$n_install_dir/node_update.sh >> $n_install_dir/node_update.log -EOF - - chmod +x "/etc/cron.daily/node_update" -} ynh_version_gt () {