luajitos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

test_lpm.lua (958B)


      1 #!/usr/bin/env luajit
      2 -- Test script for LPM
      3 
      4 local lpm = require("lpm")
      5 
      6 -- Test package from your example
      7 local test_package = [[$/data/myfolder/||||$/src/init.lua~~~~print("test123! test123! test123!")\nprint("\_-'-_/")\nprint(12345)||||$/settings/manifest.lua~~~~return { name = 'testapp', devOrCompany='luajitos', permissions = { }, allowedPaths = {}, allowedDomains = {'api.testapp.io'}}||||$/src/secondary.lua~~~~function f(a,b) return a * b end\nprint(f(3,7))]]
      8 
      9 print("Testing LPM installation...")
     10 print("Package string:")
     11 print(test_package)
     12 print("\n" .. string.rep("=", 60) .. "\n")
     13 
     14 local success, app_id = pcall(function()
     15     return lpm.install(test_package)
     16 end)
     17 
     18 if success then
     19     print("\n" .. string.rep("=", 60))
     20     print("Installation successful!")
     21     print("App ID: " .. app_id)
     22     print("\nYou can now run: luajit lpm.lua run testapp")
     23 else
     24     print("\n" .. string.rep("=", 60))
     25     print("Installation failed: " .. app_id)
     26 end