11import { PluginTester , testSpawn } from '@codifycli/plugin-test' ;
22import path from 'node:path' ;
3+ import { Utils } from '@codifycli/plugin-core' ;
34
45const pluginPath = path . resolve ( './src/index.ts' ) ;
56
@@ -9,12 +10,20 @@ await PluginTester.uninstall(pluginPath, [
910 { type : 'aws-cli' }
1011] ) ;
1112
12- await testSpawn ( 'apt-get autoremove -y ruby rpm python awscli' , { requiresRoot : true } ) ;
13+ if ( Utils . isLinux ( ) ) {
14+ await testSpawn ( 'apt-get autoremove -y ruby rpm python awscli needrestart' , { requiresRoot : true } ) ; // remove needrestart to keep logs clean.
1315
14- await testSpawn ( 'rustup self uninstall -y' ) ;
16+ await testSpawn ( 'rustup self uninstall -y' ) ;
1517
16- await testSpawn ( 'rm -rf /usr/bin/go' , { requiresRoot : true } )
17- await testSpawn ( 'rm -rf /usr/bin/python' , { requiresRoot : true } )
18- await testSpawn ( 'rm -rf /usr/bin/ruby' , { requiresRoot : true } )
18+ await testSpawn ( 'rm -rf /usr/bin/go' , { requiresRoot : true } )
19+ await testSpawn ( 'rm -rf /usr/bin/python' , { requiresRoot : true } )
20+ await testSpawn ( 'rm -rf /usr/bin/ruby' , { requiresRoot : true } )
1921
2022// await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true });
23+
24+ // MacOS
25+ } else {
26+ await PluginTester . uninstall ( pluginPath , [
27+ { type : 'brew' , formulae : [ 'chrome' , 'python' , 'ruby' , 'awscli' ] } ,
28+ ] ) ;
29+ }
0 commit comments