83 lines
3 KiB
Text
Executable file
83 lines
3 KiB
Text
Executable file
#!/usr/bin/env nu
|
|
|
|
# Provisioning Platform - Presentation Launcher (Ultra-Simple Version)
|
|
# Highly compatible with all Nushell versions
|
|
#
|
|
# Usage:
|
|
# nu run-ultra-simple.nu # Show menu and choose
|
|
# nu run-ultra-simple.nu pitch # Launch pitch presentation
|
|
# nu run-ultra-simple.nu talk # Launch talk presentation
|
|
# nu run-ultra-simple.nu full # Launch complete presentation
|
|
|
|
# Define available presentations
|
|
let presentations = [
|
|
{ idx: 1, name: "pitch.md", audience: "Executives", duration: "10 min" }
|
|
{ idx: 2, name: "demo-intro.md", audience: "Developers", duration: "15 min" }
|
|
{ idx: 3, name: "talk.md", audience: "Technical", duration: "30-45 min" }
|
|
{ idx: 4, name: "workshop.md", audience: "Learners", duration: "1-2 hours" }
|
|
{ idx: 5, name: "full.md", audience: "All", duration: "Complete" }
|
|
]
|
|
|
|
# Filter only existing files in versions/ directory
|
|
mut available = []
|
|
for p in $presentations {
|
|
if ($"versions/($p.name)" | path exists) {
|
|
$available = ($available | append $p)
|
|
}
|
|
}
|
|
|
|
if ($available | length) == 0 {
|
|
print "❌ No presentation files found!"
|
|
} else {
|
|
# Show menu
|
|
print "\n╔═══════════════════════════════════════════════════════════════╗"
|
|
print "║ Provisioning Platform - Presentation Launcher ║"
|
|
print "╚═══════════════════════════════════════════════════════════════╝\n"
|
|
|
|
for p in $available {
|
|
print $" [($p.idx)] ($p.name) │ ($p.audience) │ ($p.duration)"
|
|
}
|
|
|
|
print "\n [Q] Quit\n"
|
|
|
|
let choice = (input "Select presentation (1-5): ")
|
|
|
|
if $choice != "q" and $choice != "Q" {
|
|
# Find matching presentation
|
|
mut found = []
|
|
for p in $available {
|
|
if ($p.idx | into string) == $choice {
|
|
$found = ($found | append $p)
|
|
}
|
|
}
|
|
|
|
if ($found | length) > 0 {
|
|
let selected = ($found | get 0)
|
|
let source_file = $"versions/($selected.name)"
|
|
|
|
# Copy presentation to root
|
|
# print ""
|
|
# print $"📋 Copying: ($selected.name)"
|
|
# cp $source_file $selected.name
|
|
|
|
# Launch
|
|
print $"🚀 Launching: ($selected.name)"
|
|
print " 📺 View at: http://localhost:3030"
|
|
print " ⌨️ Press 'S' for speaker notes, 'F' for fullscreen"
|
|
print " ⌨️ Press Ctrl+C to stop server"
|
|
print ""
|
|
|
|
pnpm run dev $"versions/($selected.name)"
|
|
#pnpm run dev $selected.name
|
|
|
|
# Cleanup
|
|
#print ""
|
|
#print "🧹 Cleaning up temporary file..."
|
|
#rm $selected.name
|
|
} else {
|
|
print "❌ Invalid selection"
|
|
}
|
|
} else {
|
|
print "👋 Goodbye!"
|
|
}
|
|
}
|