Skip to content

Instantly share code, notes, and snippets.

@ShalokShalom
Created September 24, 2023 19:47
Show Gist options
  • Save ShalokShalom/05b98fd07195efb9ae715a3d89b5c4a0 to your computer and use it in GitHub Desktop.
Save ShalokShalom/05b98fd07195efb9ae715a3d89b5c4a0 to your computer and use it in GitHub Desktop.
My own little language
-- comment
--[[
multi line comment
]]--
logic - used to define a function, with the compiler option to check for purity
event - used to express an effect
macro - used to define a macro
model - used to define choice types
class - used to define record types
local - used to set something to private
model Animal
Cat
Dog
class Person
Name
Address
logic add (give_completion: paru -S)
if not updated
update --skip-mirrorlist --noconfirm
and paru -Sua --skipreview --useask --noconfirm
and sudo pkgfile --update
and log_update
and add argument
else
empty_line and set_output_color: green
and print "System is up to date."
and set_output_color: normal and empty_line
if argument_is_provided
silent sudo pacman -S --noconfirm argument
and log_update
if event_failed
silent paru -S --aur --skipreview --useask --noconfirm argument
and log_update
@ShalokShalom
Copy link
Author

ShalokShalom commented Sep 24, 2023

function add --wraps "paru -S"
   if not updated
      update --skip-mirrorlist --noconfirm &&
      paru -Sua --skipreview --useask --noconfirm &&
      sudo pkgfile --update &&
      log_update &&
      add $argv
   else
      newline
      set_color green; echo "System is up to date."
      set_color normal && newline
      
   if parameter_is_provided $argv 
      no_error sudo pacman -S --noconfirm $argv &&
      log_update
      if command_failed
         no_error paru -S --aur --skipreview --useask --noconfirm $argv &&
         log_update
         end
      end
   end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment