This repository was archived by the owner on Apr 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.bat
More file actions
129 lines (116 loc) · 3.18 KB
/
uninstall.bat
File metadata and controls
129 lines (116 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@echo off
setlocal EnableDelayedExpansion
echo.
echo Fetchify Uninstaller
echo ====================
echo.
echo Checking if Fetchify is installed globally...
cmd /c "npm ls -g --depth=0 fetchify >nul 2>&1"
set "npm_status=%errorlevel%"
if %npm_status% neq 0 (
echo Fetchify is not installed globally.
echo Checking local installation...
if exist "node_modules\fetchify" (
echo Found local Fetchify installation.
) else (
echo No Fetchify installation found.
echo.
goto END
)
) else (
echo Fetchify found in global packages.
)
echo.
echo This will remove:
echo - Global Fetchify package
echo - Local node_modules and build files
echo - Fetchify from PATH (optional)
echo.
set /p confirm=Are you sure you want to uninstall? (Y/N):
if /i not "%confirm%"=="Y" (
echo Uninstall cancelled.
goto END
)
echo.
echo Starting uninstall process...
echo.
echo Removing global Fetchify package...
cmd /c "npm uninstall -g fetchify >nul 2>&1"
if %errorlevel% equ 0 (
echo Global package removed successfully.
) else (
echo Warning: Failed to remove global package (may not be installed).
)
echo.
echo Removing local build files...
for %%d in (dist build node_modules) do (
if exist "%%d" (
rmdir /s /q "%%d"
echo Removed %%d folder.
)
)
if exist "package-lock.json" (
del /q "package-lock.json"
echo Removed package-lock.json.
)
echo.
echo Local files cleaned up.
echo.
set /p remove_path=Do you want to remove npm folder from PATH? This may affect other global npm packages (Y/N):
if /i "%remove_path%"=="Y" (
echo Removing %APPDATA%\npm from PATH...
for /f "skip=2 tokens=2,*" %%a in ('reg query HKCU\Environment /v PATH 2^>nul') do (
set "current_path=%%b"
)
if defined current_path (
set "new_path=!current_path:%APPDATA%\npm;=!"
set "new_path=!new_path:;%APPDATA%\npm=!"
set "new_path=!new_path:%APPDATA%\npm=!"
setx PATH "!new_path!" >nul
echo PATH updated successfully.
echo Note: You may need to restart your terminal for changes to take effect.
) else (
echo Could not read current PATH.
)
) else (
echo PATH left unchanged.
)
echo.
echo Checking for remaining Fetchify traces...
where fetchify >nul 2>&1
if %errorlevel% equ 0 (
echo Warning: fetchify command still found in PATH.
echo You may need to restart your terminal or manually remove it.
) else (
echo Good: fetchify command no longer found.
)
echo.
echo Cleaning npm cache (recommended)...
cmd /c "npm cache clean --force >nul 2>&1"
if %errorlevel% equ 0 (
echo npm cache cleaned.
) else (
echo Warning: Could not clean npm cache.
)
echo.
echo ================================
echo Uninstall completed!
echo ================================
echo.
echo What was removed:
echo - Global Fetchify package
echo - Local build files and dependencies
if /i "%remove_path%"=="Y" (
echo - Fetchify PATH entries
) else (
echo - PATH was left unchanged
)
echo - npm cache cleared
echo.
echo If you had other global npm packages, they should still work.
echo If you want to reinstall Fetchify, run install.bat again.
echo.
:END
echo.
echo Press any key to exit...
pause >nul