-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcheck-deps
More file actions
executable file
·103 lines (87 loc) · 2.52 KB
/
check-deps
File metadata and controls
executable file
·103 lines (87 loc) · 2.52 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
#!/usr/bin/env perl
# CLIO Dependency Checker
# Verifies all required external dependencies are present
use strict;
use warnings;
use feature 'say';
my @required_commands = qw(perl git curl stty tput script tar);
my @optional_commands = qw(readlink which);
my $all_ok = 1;
my @missing;
my @warnings;
say "CLIO Dependency Checker";
say "=" x 60;
say "";
# Check Perl version
say "[*] Checking Perl version...";
my $perl_version = $];
if ($perl_version >= 5.032) {
say " [OK] Perl $perl_version (>= 5.32 required)";
} else {
say " [FAIL] Perl $perl_version is too old (5.32+ required)";
$all_ok = 0;
push @missing, "perl 5.32+";
}
say "";
# Check required commands
say "[*] Checking required system commands...";
for my $cmd (@required_commands) {
next if $cmd eq 'perl'; # Already checked
my $path = `which $cmd 2>/dev/null`;
chomp $path;
if ($path && -x $path) {
say " [OK] $cmd found at $path";
} else {
say " [FAIL] $cmd not found";
$all_ok = 0;
push @missing, $cmd;
}
}
say "";
# Check optional commands
say "[*] Checking optional commands...";
for my $cmd (@optional_commands) {
my $path = `which $cmd 2>/dev/null`;
chomp $path;
if ($path && -x $path) {
say " [OK] $cmd found at $path";
} else {
say " [WARN] $cmd not found (optional, has fallback)";
push @warnings, $cmd;
}
}
say "";
# DEPRECATED: We don't use these anymore, CLIO has built-in implementations
# Keeping check code here for reference but removing from output
my @deprecated_modules = (
# Term::ANSIColor - replaced by CLIO::UI::ANSI
# Term::ReadKey - replaced by CLIO::Compat::Terminal
);
say "=" x 60;
if ($all_ok && !@warnings) {
say "[OK] All dependencies satisfied! CLIO should work perfectly.";
exit 0;
} elsif ($all_ok) {
say "[OK] All required dependencies satisfied.";
say "";
say "Optional items missing (won't affect core functionality):";
for my $item (@warnings) {
say " - $item";
}
exit 0;
} else {
say "[FAIL] Missing required dependencies:";
for my $item (@missing) {
say " - $item";
}
say "";
say "See docs/DEPENDENCIES.md for installation instructions.";
say "";
say "Quick install (Debian/Ubuntu):";
say " sudo apt install " . join(" ", grep { $_ ne 'perl 5.32+' } @missing);
say "";
say "Quick install (macOS):";
say " # Most tools pre-installed. If git is missing:";
say " xcode-select --install";
exit 1;
}