mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
Add dedupeName
for to puter.apps
and Dev Center
This commit is contained in:
parent
8ed5db1734
commit
b1411cd622
@ -234,7 +234,7 @@ $(document).on('click', '.create-an-app-btn', async function (e) {
|
||||
|
||||
async function create_app(title, source_path = null, items = null) {
|
||||
// name
|
||||
let name = slugify(title + '-' + Math.random().toString(36).substring(2), {
|
||||
let name = slugify(title, {
|
||||
lower: true,
|
||||
strict: true,
|
||||
});
|
||||
@ -257,6 +257,7 @@ async function create_app(title, source_path = null, items = null) {
|
||||
description: ' ',
|
||||
maximizeOnStart: false,
|
||||
background: false,
|
||||
dedupeName: true,
|
||||
})
|
||||
.then(async (app) => {
|
||||
let app_dir;
|
||||
|
@ -52,8 +52,16 @@ class Apps{
|
||||
let indexURL = args[1];
|
||||
let title = args[2] ?? args[0];
|
||||
|
||||
options = { object: { name: args[0], index_url: indexURL, title: title}};
|
||||
}else if (typeof args[0] === 'object' && args[0] !== null) {
|
||||
options = {
|
||||
object: {
|
||||
name: args[0],
|
||||
index_url: indexURL,
|
||||
title: title
|
||||
}
|
||||
};
|
||||
}
|
||||
// * allows for: puter.apps.new({name: 'example-app', indexURL: 'https://example.com'}) *
|
||||
else if (typeof args[0] === 'object' && args[0] !== null) {
|
||||
let options_raw = args[0];
|
||||
options = {
|
||||
object: {
|
||||
@ -66,6 +74,9 @@ class Apps{
|
||||
background: options_raw.background,
|
||||
filetype_associations: options_raw.filetypeAssociations,
|
||||
metadata: options_raw.metadata,
|
||||
},
|
||||
options: {
|
||||
dedupe_name: options_raw.dedupeName ?? false,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user