Skip to content
Snippets Groups Projects
Verified Commit 6078722a authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: update and format

parent 910c9388
No related branches found
No related tags found
No related merge requests found
Showing
with 287 additions and 180 deletions
......@@ -43,6 +43,7 @@ include $(MAKEFILE_IMPORT_PATH)directories-standard.mk
#include $(MAKEFILE_IMPORT_PATH)directories-go-lib.mk
#include $(MAKEFILE_IMPORT_PATH)directories-go-utilities.mk
#include $(MAKEFILE_IMPORT_PATH)directories-platform-part.mk
include $(MAKEFILE_IMPORT_PATH)go.mk
include $(MAKEFILE_IMPORT_PATH)jsdoc.mk
include $(MAKEFILE_IMPORT_PATH)output.mk
include $(MAKEFILE_IMPORT_PATH)placeholder.mk
......@@ -59,7 +60,6 @@ include $(MAKEFILE_IMPORT_PATH)license-agpl3.mk
#include $(MAKEFILE_IMPORT_PATH)license-unlicensed.mk
#include $(MAKEFILE_IMPORT_PATH)license-all-rights-reserved.mk
include $(MAKEFILE_IMPORT_PATH)jsdoc-json.mk
include $(MAKEFILE_IMPORT_PATH)go.mk
include $(MAKEFILE_IMPORT_PATH)changelog.mk
#include $(MAKEFILE_IMPORT_PATH)docman.mk
#include $(MAKEFILE_IMPORT_PATH)reqman.mk
......
......@@ -189,7 +189,10 @@ function fetchData(init, key, callback) {
const acceptedStatus = self.getOption(`${key}.acceptedStatus`, [200]);
if (acceptedStatus.indexOf(resp.status) === -1) {
throw new DataFetchError(`the response does not contain a accepted status (actual: ${resp.status}).`, response);
throw new DataFetchError(
`the response does not contain a accepted status (actual: ${resp.status}).`,
response,
);
}
return resp.text();
......
......@@ -27,7 +27,7 @@ class DataFetchError extends Error {
constructor(message, response) {
super(message);
this[internalSymbol] = {
response: response
response: response,
};
}
......@@ -46,5 +46,4 @@ class DataFetchError extends Error {
getResponse() {
return this[internalSymbol]["response"];
}
}
......@@ -674,7 +674,6 @@ function transform(value) {
}
case "datetimeformat":
date = new Date(value);
if (isNaN(date.getTime())) {
throw new Error("invalid date");
......@@ -687,7 +686,7 @@ function transform(value) {
try {
locale = getLocaleOfDocument();
return new Intl.DateTimeFormat(locale, options).format(date)
return new Intl.DateTimeFormat(locale, options).format(date);
} catch (e) {
throw new Error(`unsupported locale or missing format (${e.message})`);
}
......
......@@ -61,7 +61,7 @@ export {
customElementUpdaterLinkSymbol,
initControlCallbackName,
ATTRIBUTE_SCRIPT_HOST,
ATTRIBUTE_INIT_CALLBACK
ATTRIBUTE_INIT_CALLBACK,
};
/**
......
......@@ -49,7 +49,6 @@ const attachedInternalSymbol = Symbol("attachedInternal");
* @extends Monster.DOM.CustomElement
*/
class CustomControl extends CustomElement {
/**
* The constructor method of CustomControl, which is called when creating a new instance.
* It checks whether the element supports `attachInternals()` and initializes an internal form-associated element
......@@ -79,7 +78,6 @@ class CustomControl extends CustomElement {
initObserver.call(this);
}
/**
* This method is called by the `instanceof` operator.
* @returns {symbol}
......@@ -142,7 +140,6 @@ class CustomControl extends CustomElement {
throw Error("the value setter must be overwritten by the derived class");
}
/**
* This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)
*
......@@ -327,14 +324,11 @@ class CustomControl extends CustomElement {
}
}
/**
* @param {string} state
* @param {string} mode
*/
formStateRestoreCallback(state, mode) {
}
formStateRestoreCallback(state, mode) {}
/**
*
......@@ -342,7 +336,6 @@ class CustomControl extends CustomElement {
formResetCallback() {
this.value = "";
}
}
/**
......
......@@ -27,7 +27,7 @@ import {
ATTRIBUTE_OPTIONS_SELECTOR,
ATTRIBUTE_SCRIPT_HOST,
customElementUpdaterLinkSymbol,
initControlCallbackName
initControlCallbackName,
} from "./constants.mjs";
import { findDocumentTemplate, Template } from "./template.mjs";
import { addObjectWithUpdaterToElement } from "./updater.mjs";
......@@ -220,7 +220,6 @@ class CustomElement extends HTMLElement {
this[initMethodSymbol]();
initOptionObserver.call(this);
this[scriptHostElementSymbol] = [];
}
/**
......@@ -445,8 +444,7 @@ class CustomElement extends HTMLElement {
try {
value = new Pathfinder(this[internalSymbol].getRealSubject()["options"]).getVia(path);
} catch (e) {
}
} catch (e) {}
if (value === undefined) return defaultValue;
return value;
......@@ -574,22 +572,18 @@ class CustomElement extends HTMLElement {
// Check if the object has already been initialized
if (!hasObjectLink(self, customElementUpdaterLinkSymbol)) {
// If not, call the assembleMethod to initialize the object
self[assembleMethodSymbol]();
}
}
/**
* Called every time the element is removed from the DOM. Useful for running clean up code.
*
* @return {void}
* @since 1.7.0
*/
disconnectedCallback() {
}
disconnectedCallback() {}
/**
* The custom element has been moved into a new document (e.g. someone called document.adoptNode(el)).
......@@ -597,8 +591,7 @@ class CustomElement extends HTMLElement {
* @return {void}
* @since 1.7.0
*/
adoptedCallback() {
}
adoptedCallback() {}
/**
* Called when an observed attribute has been added, removed, updated, or replaced. Also called for initial
......@@ -615,7 +608,7 @@ class CustomElement extends HTMLElement {
const self = this;
if (attrName.startsWith("data-monster-option-")) {
setOptionFromAttribute(self, attrName, this[internalSymbol].getSubject()["options"])
setOptionFromAttribute(self, attrName, this[internalSymbol].getSubject()["options"]);
}
const callback = self[attributeObserverSymbol]?.[attrName];
......@@ -625,7 +618,6 @@ class CustomElement extends HTMLElement {
} catch (e) {
addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, e.toString());
}
}
}
......@@ -661,8 +653,6 @@ class CustomElement extends HTMLElement {
const self = this;
return callControlCallback.call(self, name, ...args);
}
}
/**
......@@ -679,7 +669,6 @@ function callControlCallback(callBackFunctionName, ...args) {
if (callBackFunctionName in self) {
return self[callBackFunctionName](self, ...args);
}
if (!self.hasAttribute(ATTRIBUTE_SCRIPT_HOST)) {
......@@ -687,13 +676,12 @@ function callControlCallback(callBackFunctionName, ...args) {
}
if (self[scriptHostElementSymbol].length === 0) {
const targetId = self.getAttribute(ATTRIBUTE_SCRIPT_HOST);
if (!targetId) {
return;
}
const list = targetId.split(",")
const list = targetId.split(",");
for (const id of list) {
const host = findElementWithIdUpwards(self, targetId);
if (!(host instanceof HTMLElement)) {
......@@ -715,7 +703,6 @@ function callControlCallback(callBackFunctionName, ...args) {
}
addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, `callback ${callBackFunctionName} not found`);
}
/**
......@@ -746,7 +733,6 @@ function initFromCallbackHost() {
callControlCallback.call(self, callBackFunctionName);
}
/**
* This method is called when the element is first created.
*
......@@ -763,7 +749,11 @@ function attachAttributeChangeMutationObserver() {
self[attributeMutationObserverSymbol] = new MutationObserver(function (mutations, observer) {
for (const mutation of mutations) {
if (mutation.type === "attributes") {
self.attributeChangedCallback(mutation.attributeName, mutation.oldValue, mutation.target.getAttribute(mutation.attributeName));
self.attributeChangedCallback(
mutation.attributeName,
mutation.oldValue,
mutation.target.getAttribute(mutation.attributeName),
);
}
}
});
......@@ -773,7 +763,6 @@ function attachAttributeChangeMutationObserver() {
attributes: true,
attributeOldValue: true,
});
} catch (e) {
addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, e.toString());
}
......@@ -971,8 +960,7 @@ function parseOptionsJSON(data) {
try {
let dataUrl = parseDataURL(data);
data = dataUrl.content;
} catch (e) {
}
} catch (e) {}
try {
obj = JSON.parse(data);
......
......@@ -75,10 +75,8 @@ function getDeviceDPI() {
*/
function convertToPixels(value, parentElement = document.documentElement, fontSizeElement = document.documentElement) {
validateString(value);
const regex = /^(-?[\d.]+)(.*)$/;
const matchResult = value.match(regex);
......
......@@ -209,7 +209,11 @@ function traverseShadowRoots(element) {
let currentRoot = element.shadowRoot;
let currentParent = element.parentNode;
while (currentParent && currentParent.nodeType !== Node.DOCUMENT_NODE && currentParent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
while (
currentParent &&
currentParent.nodeType !== Node.DOCUMENT_NODE &&
currentParent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE
) {
if (currentRoot && currentRoot.parentNode) {
currentParent = currentRoot.parentNode;
currentRoot = currentParent.shadowRoot;
......@@ -238,8 +242,11 @@ function traverseShadowRoots(element) {
* @since 3.36.0
*/
function getContainingDocument(element) {
if (!element || !(element instanceof HTMLElement || element instanceof element.ownerDocument.defaultView.HTMLElement)) {
throw new Error('Invalid argument. Expected an HTMLElement.');
if (
!element ||
!(element instanceof HTMLElement || element instanceof element.ownerDocument.defaultView.HTMLElement)
) {
throw new Error("Invalid argument. Expected an HTMLElement.");
}
return traverseShadowRoots(element) || null;
......
......@@ -5,7 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
export {extractKeys}
export { extractKeys };
/**
* Extracts the keys from the given object and returns a map with the keys and values.
......@@ -17,17 +17,21 @@ export {extractKeys}
* @param {string} valueSeparator
* @returns {Map<any, any>}
*/
function extractKeys(obj, keyPrefix = '', keySeparator = '-', valueSeparator = '.') {
function extractKeys(obj, keyPrefix = "", keySeparator = "-", valueSeparator = ".") {
const resultMap = new Map();
function helper(currentObj, currentKeyPrefix, currentValuePrefix) {
for (const key in currentObj) {
if (typeof currentObj[key] === 'object' && !Array.isArray(currentObj[key])) {
const newKeyPrefix = currentKeyPrefix ? currentKeyPrefix + keySeparator + key.toLowerCase() : key.toLowerCase();
if (typeof currentObj[key] === "object" && !Array.isArray(currentObj[key])) {
const newKeyPrefix = currentKeyPrefix
? currentKeyPrefix + keySeparator + key.toLowerCase()
: key.toLowerCase();
const newValuePrefix = currentValuePrefix ? currentValuePrefix + valueSeparator + key : key;
helper(currentObj[key], newKeyPrefix, newValuePrefix);
} else {
const finalKey = currentKeyPrefix ? currentKeyPrefix + keySeparator + key.toLowerCase() : key.toLowerCase();
const finalKey = currentKeyPrefix
? currentKeyPrefix + keySeparator + key.toLowerCase()
: key.toLowerCase();
const finalValue = currentValuePrefix ? currentValuePrefix + valueSeparator + key : key;
resultMap.set(finalKey, finalValue);
}
......
......@@ -5,8 +5,8 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Pathfinder} from '../../data/pathfinder.mjs';
import {isFunction} from '../../types/is.mjs';
import { Pathfinder } from "../../data/pathfinder.mjs";
import { isFunction } from "../../types/is.mjs";
import { attributeObserverSymbol } from "../customelement.mjs";
import { extractKeys } from "./extract-keys.mjs";
......@@ -41,7 +41,7 @@ export {initOptionsFromAttributes};
* @returns {Object} - The initialized options object.
* @this HTMLElement - The context of the DOM element.
*/
function initOptionsFromAttributes(element, options, mapping = {}, prefix = 'data-monster-option-') {
function initOptionsFromAttributes(element, options, mapping = {}, prefix = "data-monster-option-") {
if (!(element instanceof HTMLElement)) return options;
if (!element.hasAttributes()) return options;
......@@ -65,21 +65,19 @@ function initOptionsFromAttributes(element, options, mapping = {}, prefix = 'dat
}
const typeOfOptionValue = typeof finder.getVia(optionName);
if (typeOfOptionValue === 'boolean') {
value = value === 'true';
} else if (typeOfOptionValue === 'number') {
if (typeOfOptionValue === "boolean") {
value = value === "true";
} else if (typeOfOptionValue === "number") {
value = Number(value);
} else if (typeOfOptionValue === 'string') {
} else if (typeOfOptionValue === "string") {
value = String(value);
} else if (typeOfOptionValue === 'object') {
} else if (typeOfOptionValue === "object") {
value = JSON.parse(value);
}
finder.setVia(optionName, value);
}
})
});
return options;
}
......@@ -5,8 +5,8 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Pathfinder} from '../../data/pathfinder.mjs';
import {isFunction} from '../../types/is.mjs';
import { Pathfinder } from "../../data/pathfinder.mjs";
import { isFunction } from "../../types/is.mjs";
import { attributeObserverSymbol } from "../customelement.mjs";
import { extractKeys } from "./extract-keys.mjs";
......@@ -42,7 +42,7 @@ export {setOptionFromAttribute};
* @returns {Object} - The initialized options object.
* @this HTMLElement - The context of the DOM element.
*/
function setOptionFromAttribute(element, name, options, mapping = {}, prefix = 'data-monster-option-') {
function setOptionFromAttribute(element, name, options, mapping = {}, prefix = "data-monster-option-") {
if (!(element instanceof HTMLElement)) return options;
if (!element.hasAttributes()) return options;
......@@ -65,13 +65,13 @@ function setOptionFromAttribute(element, name, options, mapping = {}, prefix = '
}
const typeOfOptionValue = typeof finder.getVia(optionName);
if (typeOfOptionValue === 'boolean') {
value = value === 'true';
} else if (typeOfOptionValue === 'number') {
if (typeOfOptionValue === "boolean") {
value = value === "true";
} else if (typeOfOptionValue === "number") {
value = Number(value);
} else if (typeOfOptionValue === 'string') {
} else if (typeOfOptionValue === "string") {
value = String(value);
} else if (typeOfOptionValue === 'object') {
} else if (typeOfOptionValue === "object") {
value = JSON.parse(value);
}
......@@ -79,5 +79,3 @@ function setOptionFromAttribute(element, name, options, mapping = {}, prefix = '
return options;
}
......@@ -21,10 +21,6 @@ export { ConsoleHandler };
* @memberOf Monster.Logging.Handler
*/
class ConsoleHandler extends Handler {
constructor() {
super();
}
/**
* This is the central log function. this method must be
* overwritten by derived handlers with their own logic.
......
......@@ -5,7 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
export {parseBracketedKeyValueHash, createBracketedKeyValueHash}
export { parseBracketedKeyValueHash, createBracketedKeyValueHash };
/**
* Parses a string containing bracketed key-value pairs and returns an object representing the parsed result.
......@@ -49,8 +49,7 @@ function parseBracketedKeyValueHash(hashString) {
//const keyValueStack = [];
const trimmedHashString = hashString.trim();
const cleanedHashString = trimmedHashString.charAt(0) === '#' ? trimmedHashString.slice(1) : trimmedHashString;
const cleanedHashString = trimmedHashString.charAt(0) === "#" ? trimmedHashString.slice(1) : trimmedHashString;
//const selectors = (keyValueStack.length > 0) ? result[selectorStack[selectorStack.length - 1]] : result;
let currentSelector = "";
......@@ -65,20 +64,20 @@ function parseBracketedKeyValueHash(hashString) {
}
}
let currentKey = '';
let currentValue = '';
let currentKey = "";
let currentValue = "";
let inKey = true;
let inValue = false;
let inQuotedValue = false;
let inSelector = true;
let escaped = false;
let quotedValueStartChar = '';
let quotedValueStartChar = "";
for (let i = 0; i < cleanedHashString.length; i++) {
const c = cleanedHashString[i];
const nextChar = cleanedHashString?.[i + 1];
if (c === '\\' && !escaped) {
if (c === "\\" && !escaped) {
escaped = true;
continue;
}
......@@ -96,7 +95,6 @@ function parseBracketedKeyValueHash(hashString) {
}
if (inQuotedValue && quotedValueStartChar !== c) {
if (inSelector) {
currentSelector += c;
} else if (inKey) {
......@@ -108,19 +106,18 @@ function parseBracketedKeyValueHash(hashString) {
continue;
}
if (c === ';' && inSelector) {
if (c === ";" && inSelector) {
inSelector = true;
currentSelector = "";
continue;
}
if (inSelector === true && c !== '(') {
if (inSelector === true && c !== "(") {
currentSelector += c;
continue;
}
if (c === '(' && inSelector) {
if (c === "(" && inSelector) {
inSelector = false;
inKey = true;
......@@ -128,13 +125,12 @@ function parseBracketedKeyValueHash(hashString) {
continue;
}
if (inKey === true && c !== '=') {
if (inKey === true && c !== "=") {
currentKey += c;
continue;
}
if (c === '=' && inKey) {
if (c === "=" && inKey) {
inKey = false;
inValue = true;
......@@ -160,7 +156,7 @@ function parseBracketedKeyValueHash(hashString) {
continue;
}
if (c === ',') {
if (c === ",") {
inValue = false;
inKey = true;
const decodedCurrentValue = decodeURIComponent(currentValue);
......@@ -170,7 +166,7 @@ function parseBracketedKeyValueHash(hashString) {
continue;
}
if (c === ')') {
if (c === ")") {
inValue = false;
//inKey = true;
inSelector = true;
......@@ -189,14 +185,11 @@ function parseBracketedKeyValueHash(hashString) {
}
}
if (inSelector) {
return selectors;
}
return {};
}
/**
......@@ -208,38 +201,37 @@ function parseBracketedKeyValueHash(hashString) {
* @since 3.37.0
*/
function createBracketedKeyValueHash(object, addHashPrefix = true) {
if (!object) {
return addHashPrefix ? '#' : '';
return addHashPrefix ? "#" : "";
}
let hashString = '';
let hashString = "";
function encodeKeyValue(key, value) {
return encodeURIComponent(key) + '=' + encodeURIComponent(value);
return encodeURIComponent(key) + "=" + encodeURIComponent(value);
}
for (const selector in object) {
if (object.hasOwnProperty(selector)) {
const keyValuePairs = object[selector];
let selectorString = selector;
let keyValueString = '';
let keyValueString = "";
for (const key in keyValuePairs) {
if (keyValuePairs.hasOwnProperty(key)) {
const value = keyValuePairs[key];
keyValueString += keyValueString.length === 0 ? '' : ',';
keyValueString += keyValueString.length === 0 ? "" : ",";
keyValueString += encodeKeyValue(key, value);
}
}
if (keyValueString.length > 0) {
selectorString += '(' + keyValueString + ')';
hashString += hashString.length === 0 ? '' : ';';
selectorString += "(" + keyValueString + ")";
hashString += hashString.length === 0 ? "" : ";";
hashString += selectorString;
}
}
}
return addHashPrefix ? '#' + hashString : hashString;
return addHashPrefix ? "#" + hashString : hashString;
}
export { generateRangeComparisonExpression } from "./generate-range-comparison-expression.mjs"
export { generateRangeComparisonExpression } from "./generate-range-comparison-expression.mjs";
#############################################################################################
#############################################################################################
##
## DEFINE BLACKBOX
##
#############################################################################################
#############################################################################################
EXECUTABLES = $(EXECUTABLES:-) gpgconf git
BLACKBOX_ROOT_DIR = $(PROJECT_ROOT)
BLACKBOX_BUILD_DIR = $(BLACKBOX_ROOT_DIR)build/blackbox
BLACKBOX_CONFIG_PATH = $(BLACKBOX_ROOT_DIR).blackbox
BLACKBOX_GPG_PATH = $(shell gpgconf --list-dirs homedir)
# The default image of blackbox
# only local image is supported
BLACKBOX_IMAGE_NAME= blackbox_local_temp_image
BLACKBOX_IMAGE_HASH = $(shell git log --format="%h" -n 1)
BLACKBOX_IMAGE = $(BLACKBOX_IMAGE_NAME):$(BLACKBOX_IMAGE_HASH)
define BLACKBOX_RUN_SCRIPT
#!/bin/bash
function cleanup()
{
for FILE in $$(blackbox_list_files); do
blackbox_edit_end $${FILE} || exit 1
done
exit 0
}
if [ "$$#" -ne 1 ]; then
## args are: open, close, run
echo "Usage: $$0 open|close|run"
exit 1
fi
## trap if arg is run
if [ "$$1" == "run" ]; then
# Intercepts the signal and then executes the command to encrypt.
trap cleanup INT TERM SIGTERM SIGUSR1
fi
if [ "$$1" == "open" ] || [ "$$1" == "run" ]; then
echo "Opening files..."
for FILE in $$(blackbox_list_files); do
blackbox_edit_start $${FILE} || exit 1
done
fi
if [ "$$1" == "close" ]; then
echo "Closing files..."
for FILE in $$(blackbox_list_files); do
blackbox_edit_end $${FILE} || exit 1
done
elif [ "$$1" == "run" ]; then
echo "Running command..."
while true; do
sleep 1
done
elif [ "$$1" == "open" ]; then
exit 0
else
echo "Unknown command: $$1"
exit 1
fi
endef
define BLACKBOX_DOCKERFILE
FROM docker-registry.schukai.com:443/debian-bullseye-amd64-slim:snapshot AS deb-builder
RUN apt-get update && apt-get install git make rubygems build-essential
RUN cd /opt/ && \
git clone https://github.com/StackExchange/blackbox.git
RUN gem install fpm
RUN cd /opt/blackbox && \
make packages-deb
FROM docker-registry.schukai.com:443/debian-bullseye-amd64-slim:snapshot
RUN apt-get update && apt-get install git gnupg
RUN sed -i /NAME=/s/=.*/'="Blackbox"'/ /etc/container-release ;
COPY --from=deb-builder /root/debbuild-stack_blackbox/ /tmp/
RUN apt-get install /tmp/*.deb
RUN mkdir /repos /root/.gnupg
VOLUME [ "/repos" ]
WORKDIR /repos
COPY ./filesystem/bin /bin/
RUN chmod ugo+x /bin/run-blackbox.sh
ARG UNAME=dummy
ARG UID=1000
ARG GID=1000
RUN groupadd -g $$GID -o $$UNAME
RUN useradd -m -u $$UID -g $$GID -o -s /bin/bash $$UNAME
ENTRYPOINT [ "/bin/run-blackbox.sh" ]
endef
\ No newline at end of file
......@@ -11,6 +11,11 @@ SOURCE_PATH ?= $(PROJECT_ROOT)source/
RELATIVE_SCRIPT_PATH ?= script/
SCRIPT_PATH ?= $(PROJECT_ROOT)$(RELATIVE_SCRIPT_PATH)
## DEPRECATED ALIAS
SCRIPTS_PATH = $(SCRIPT_PATH)
VENDOR_PATH ?= $(PROJECT_ROOT)vendor/
NODE_PATH ?= $(PROJECT_ROOT)node_modules/
TEST_PATH ?= $(PROJECT_ROOT)test/
......
......@@ -8,8 +8,9 @@
# path and binaries
GO := go
GOLINT := golint
EXECUTABLES = $(EXECUTABLES:-) $(GO);
EXECUTABLES = $(EXECUTABLES:-) $(GO) $(GOLINT);
ifeq ($(shell command -v $(GO) 2> /dev/null),)
$(error "go is not installed. Please install go <https://go.dev/doc/install>")
......@@ -25,3 +26,9 @@ ifeq ($(GOPATH),)
export PATH=$(PATH):$(GOPATH)/bin
endif
ifdef SOURCE_PATH
PKG_LIST := $(shell if [ -d "SOURCE_PATH" ] ; then cd $(SOURCE_PATH); $(GO) list ./... | grep -v /vendor/ ; fi)
GO_FILES := $(shell if [ -d "SOURCE_PATH" ] ; then cd $(SOURCE_PATH); find . -name '*.go' | grep -v /vendor/ | grep -v _test.go; fi)
endif
......@@ -6,6 +6,10 @@
#############################################################################################
#############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
ifneq "$(wildcard $(SOURCE_PATH) )" ""
## Files wich should be checked for license headers
LICENSE_FILE_PATTERN ?= $(shell find $(SOURCE_PATH) -type f \( -iname \*.go -o -iname \*.php -o -iname \*.js -o -iname \*.mjs -o -iname \*.cjs \) )
......
......@@ -18,14 +18,20 @@ To check out docs and examples, visit ....
## Installation
If you want to install the latest version of this tool, you can use the following command:
```shell
go get $(shell git config --get remote.origin.url | sed -E 's/^\s*.*:\/\///g')
wget -O ./$(COMPONENT_SLUG) http://download.schukai.com/tools/$(COMPONENT_SLUG)/$(COMPONENT_SLUG)-$$( uname -s | tr [:upper:] [:lower:])-$$(echo uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
```
**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
## Usage
The following command will show you the help of the tool:
```shell
$(COMPONENT_SLUG) help
```
## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment