Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created March 4, 2024 10:33
Show Gist options
  • Save naranyala/d0e80a832ed76590093fc9843a44ce5d to your computer and use it in GitHub Desktop.
Save naranyala/d0e80a832ed76590093fc9843a44ce5d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Bash script to initiate a new Lua project
# Check if the user wants to create a new directory
read -p "Do you want to create a new directory for your Lua project? (y/n): " create_new_directory
if [ "$create_new_directory" == "y" ]; then
# Get project name from user input
read -p "Enter your Lua project name: " project_name
mkdir "$project_name"
cd "$project_name" || exit
fi
# Create main Lua script
touch main.lua
echo "-- main.lua" >>main.lua
echo "print('Hello, Lua World!')" >>main.lua
# Inform user about the next steps
echo -e "\nYour Lua project has been initialized!"
echo -e "To run your Lua script, use: \n\n\tlua main.lua\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment