Skip to content

Commit 416a017

Browse files
committed
Fixed path resolve issues and redundant state mutability output.
1 parent 12cef12 commit 416a017

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

builders/function-code-builder.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,7 @@ module.exports = {
6464

6565
builder.push(node.visibility.toLowerCase());
6666

67-
if(node.payable) {
68-
builder.push(" payable");
69-
}
70-
71-
if(["nonpayable", ""].indexOf(node.stateMutability) >= 0) {
72-
builder.push(` ${node.StateMutability}`);
73-
}
67+
builder.push(` ${node.stateMutability}`);
7468

7569
if(modifierList && modifierList.length) {
7670
builder.push(` ${modifierList.join(" ")} `);

cli.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ const logger = pino({
2020
3. Do not recompile. Optional, default: false.
2121
4. Language. Optional, default: en.
2222
*************************************************************************************************/
23-
const args = process.argv;
24-
25-
if(args.length > 6) {
26-
logger.error(`Invalid command ${process.argv.join(" ")}`);
27-
return;
28-
}
29-
3023
function getConfig() {
3124
function readConfig() {
3225
const file = path.join(process.cwd(), "solidoc.json");
@@ -42,14 +35,23 @@ function getConfig() {
4235
};
4336

4437
var config = readConfig();
38+
const args = process.argv;
39+
40+
if(args.length > 6) {
41+
logger.error(`Invalid command ${process.argv.join(" ")}`);
42+
return;
43+
}
4544

4645
if(args.length > 2) {
47-
config.pathToRoot = resolve(args[2]);
48-
config.outputPath = resolve(args[3]);
46+
config.pathToRoot = args[2];
47+
config.outputPath = args[3];
4948
config.noCompilation = (args[4] || "").toLowerCase().startsWith("t");
5049
config.language = args[5] || "en";
5150
}
5251

52+
config.pathToRoot = resolve(config.pathToRoot);
53+
config.outputPath = resolve(config.outputPath);
54+
5355
return config;
5456
}
5557

solidoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"pathToRoot": "../openzeppelin-solidity",
33
"outputPath": "../openzeppelin-solidity/docs",
4-
"noCompilation": false,
4+
"noCompilation": true,
55
"compiler": "truffle compile",
66
"language": "en"
77
}

0 commit comments

Comments
 (0)