fix(FlowHelpers): restore official fileUtils.js and only install custom copyWithProgress
Build / Lint & Test (push) Successful in 1m0s
Build / Lint & Test (push) Successful in 1m0s
This commit is contained in:
1 parent
3d809c6862
commit
07b730c81f
2 files changed
+288
-21
No files matched your search
+19
-9
@@ -92,17 +92,27 @@ download_plugin() {
|
||||
|
||||
download_flow_helpers() {
|
||||
local dest="${PLUGIN_DIR}/FlowHelpers/1.0.0"
|
||||
local helpers=("copyWithProgress.js" "cliUtils.js" "fileUtils.js")
|
||||
mkdir -p "$dest"
|
||||
for helper in "${helpers[@]}"; do
|
||||
local url="${RAW}/FlowHelpers/1.0.0/${helper}"
|
||||
if curl -fsSL "$url" -o "${dest}/${helper}"; then
|
||||
echo " ✓ FlowHelper ${helper} → ${dest}/${helper}"
|
||||
else
|
||||
echo " ✗ Failed to download ${helper} from ${url}"
|
||||
return 1
|
||||
|
||||
# Restore official Tdarr fileUtils.js if it was previously overwritten by a mock
|
||||
local official_fu="https://raw.githubusercontent.com/HaveAGitGat/Tdarr_Plugins/master/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js"
|
||||
if [[ -f "${dest}/fileUtils.js" ]]; then
|
||||
if grep -q "Local mock of Tdarr" "${dest}/fileUtils.js" || ! grep -q "getFileAbsoluteDir" "${dest}/fileUtils.js"; then
|
||||
echo " 🔄 Restoring official Tdarr fileUtils.js..."
|
||||
curl -fsSL "$official_fu" -o "${dest}/fileUtils.js" || true
|
||||
fi
|
||||
done
|
||||
else
|
||||
curl -fsSL "$official_fu" -o "${dest}/fileUtils.js" || true
|
||||
fi
|
||||
|
||||
# Download our custom copyWithProgress helper
|
||||
local url="${RAW}/FlowHelpers/1.0.0/copyWithProgress.js"
|
||||
if curl -fsSL "$url" -o "${dest}/copyWithProgress.js"; then
|
||||
echo " ✓ FlowHelper copyWithProgress.js → ${dest}/copyWithProgress.js"
|
||||
else
|
||||
echo " ✗ Failed to download copyWithProgress.js from ${url}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
clean_deprecated_plugins() {
|
||||
|
||||
Reference in new issue
Block a user