mirror of
https://github.com/Budibase/budibase.git
synced 2026-09-19 02:11:00 +08:00
Add linting on hosting
This commit is contained in:
@@ -16,7 +16,6 @@ packages/worker/src/constants/templates/tests/
|
||||
.github
|
||||
.vscode
|
||||
examples
|
||||
hosting
|
||||
i18n
|
||||
/.nx/cache
|
||||
/.nx/workspace-data
|
||||
@@ -52,9 +52,7 @@ export async function init(opts: any) {
|
||||
const message = isSingle
|
||||
? "This will create a single-image docker-compose.yaml in current directory, should continue?"
|
||||
: "This will create multiple files in current directory, should continue?"
|
||||
const shouldContinue = await confirmation(
|
||||
message
|
||||
)
|
||||
const shouldContinue = await confirmation(message)
|
||||
if (!shouldContinue) {
|
||||
console.log("Stopping.")
|
||||
return
|
||||
|
||||
@@ -29,10 +29,16 @@ function isSingleComposeServiceList(services: Record<string, unknown>) {
|
||||
export async function update(opts?: unknown) {
|
||||
const { services } = getServices(COMPOSE_PATH)
|
||||
const singleFlag =
|
||||
typeof opts === "object" && opts != null && "single" in opts && !!opts.single
|
||||
typeof opts === "object" &&
|
||||
opts != null &&
|
||||
"single" in opts &&
|
||||
!!opts.single
|
||||
const isSingle = singleFlag || isSingleComposeServiceList(services)
|
||||
|
||||
if (singleFlag && !Object.prototype.hasOwnProperty.call(services, "budibase")) {
|
||||
if (
|
||||
singleFlag &&
|
||||
!Object.prototype.hasOwnProperty.call(services, "budibase")
|
||||
) {
|
||||
throw "Unable to run single-image update: no 'budibase' service found in docker-compose.yaml."
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,7 @@ export const API = createAPIClient({
|
||||
const embedLocation = window["##BUDIBASE_EMBED_LOCATION##"]
|
||||
if (appData.embedded || embedLocation) {
|
||||
headers["x-budibase-embed-location"] =
|
||||
embedLocation ||
|
||||
window.location.pathname
|
||||
embedLocation || window.location.pathname
|
||||
}
|
||||
|
||||
// Attach client header if not inside the builder preview
|
||||
|
||||
@@ -180,7 +180,9 @@ const normalizeRoutePath = (path: string) => {
|
||||
return "/"
|
||||
}
|
||||
const [pathname = "/", query = ""] = path.split("?")
|
||||
const normalizedPathname = pathname.startsWith("/") ? pathname : `/${pathname}`
|
||||
const normalizedPathname = pathname.startsWith("/")
|
||||
? pathname
|
||||
: `/${pathname}`
|
||||
if (!query) {
|
||||
return normalizedPathname
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user