Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
1805927b
Commit
1805927b
authored
Feb 09, 2021
by
Michael Long
Browse files
Make it possible to copy/move doors and sections from one BBS system to another
parent
c2959cc0
Pipeline
#1299
passed with stage
in 11 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
exec/importcfg.js
exec/importcfg.js
+37
-3
No files found.
exec/importcfg.js
View file @
1805927b
...
...
@@ -4,7 +4,6 @@
// *****************************************************************
"
use strict
"
;
var
cnflib
=
load
({},
"
cnflib.js
"
);
var
file_cnf
=
cnflib
.
read
(
"
file.cnf
"
);
...
...
@@ -117,19 +116,54 @@ if(!cnf) {
alert
(
"
Failed to read
"
+
cnf_fname
);
exit
(
-
1
);
}
writeln
(
"
Backing up
"
+
cnf_fname
);
file_backup
(
cnf_fname
,
15
);
if
(
cnf_obj
==
'
xtrn
'
)
{
var
secs
=
{};
for
(
var
i
in
cnf
[
'
xtrnsec
'
])
{
secs
[
cnf
[
'
xtrnsec
'
][
i
][
'
code
'
].
toUpperCase
()]
=
i
;
}
}
for
(
var
i
in
list
)
{
var
obj
=
list
[
i
];
var
j
;
for
(
j
=
0
;
j
<
cnf
[
cnf_obj
].
length
;
j
++
)
{
if
(
cnf
[
cnf_obj
][
j
].
code
!==
undefined
)
{
if
(
cnf
[
cnf_obj
][
j
].
code
==
obj
.
code
)
if
(
cnf
[
cnf_obj
][
j
].
code
.
toUpperCase
()
==
obj
.
code
.
toUpperCase
()
)
break
;
}
else
{
if
(
cnf
[
cnf_obj
][
j
].
name
==
obj
.
name
)
if
(
cnf
[
cnf_obj
][
j
].
name
.
toUpperCase
()
==
obj
.
name
.
toUpperCase
()
)
break
;
}
}
obj
.
code
=
obj
.
code
.
toUpperCase
();
switch
(
cnf_obj
)
{
case
'
xtrnsec
'
:
delete
obj
.
number
;
delete
obj
.
index
;
break
;
case
'
xtrn
'
:
obj
.
sec_code
=
obj
.
sec_code
.
toUpperCase
();
delete
obj
.
number
;
delete
obj
.
index
;
delete
obj
.
sec_index
;
delete
obj
.
sec_number
;
if
(
typeof
secs
[
obj
.
sec_code
]
===
"
undefined
"
)
{
writeln
(
"
Could not find section
"
+
obj
.
sec_code
+
"
for program
"
+
(
obj
.
code
||
obj
.
name
));
continue
;
}
else
{
obj
.
sec
=
secs
[
obj
.
sec_code
];
}
break
;
default
:
break
;
}
if
(
j
<
cnf
[
cnf_obj
].
length
)
{
if
(
!
options
.
overwrite
)
{
writeln
(
"
Already exists:
"
+
(
obj
.
name
||
obj
.
code
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment