From 7d8845a0c279557433b68bc5b08e0f4f09668b11 Mon Sep 17 00:00:00 2001 From: ChristophLHR <11349102+ChristophLHR@users.noreply.github.com> Date: Sat, 3 Sep 2022 21:36:12 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 8a8ca5a..125c667 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,22 @@ Shows all available configurations. ## help Shows all available commands and their description. - ``: Shows the description of a command by name. + +## Requires +If you want to load a library within a program and keep it updated through SCM, then you can do that with the following notation: + +```lua +local scm = require("./scm") +scm:load("testLibrary") +``` + +If the Library is already called by a Programm using this SCM loader, SCM will check all Libraries loaded for these comments: + + +```lua +--@requires testLibrary +require("testLibrary") +``` + +The comment tells SCM to look for the sub-library and, if it's not already installed, it will try to download it. +This prevent the programm from Crashing, should SCM not be installed. From 9522261c24816b3d238f239470826ec6f2c6f313 Mon Sep 17 00:00:00 2001 From: ChristophLHR <11349102+ChristophLHR@users.noreply.github.com> Date: Sat, 3 Sep 2022 21:40:44 +0200 Subject: [PATCH 2/2] Change 2. Library Name --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 125c667..16eaf02 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ If the Library is already called by a Programm using this SCM loader, SCM will c ```lua ---@requires testLibrary -require("testLibrary") +--@requires subLibrary +require("subLibrary") ``` The comment tells SCM to look for the sub-library and, if it's not already installed, it will try to download it.