@aptos-labs/aptos-cli 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aptos +4 -3
- package/package.json +2 -2
package/bin/aptos
CHANGED
|
@@ -49,7 +49,7 @@ const executableIsAvailable = (name) => {
|
|
|
49
49
|
// Query the GitHub API to find the latest CLI release. We assume that the CLI is in
|
|
50
50
|
// the last 100 releases so we don't paginate through the releases.
|
|
51
51
|
const getLatestVersionGh = async () => {
|
|
52
|
-
const prefix = `${PNAME}
|
|
52
|
+
const prefix = `${PNAME}-v`;
|
|
53
53
|
const response = await (await fetch("https://api.github.com/repos/aptos-labs/aptos-core/releases?per_page=100")).json();
|
|
54
54
|
for (release of response) {
|
|
55
55
|
if (release["tag_name"].startsWith(`${prefix}`)) {
|
|
@@ -89,7 +89,7 @@ const main = async () => {
|
|
|
89
89
|
path = "";
|
|
90
90
|
}
|
|
91
91
|
} else {
|
|
92
|
-
path = `${__dirname}
|
|
92
|
+
path = `${__dirname}\\${PNAME}.exe`;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// If binary does not exist, download it.
|
|
@@ -108,7 +108,7 @@ const main = async () => {
|
|
|
108
108
|
if (os === "Windows") {
|
|
109
109
|
// Download the zip file, extract it, and move the binary to the correct location.
|
|
110
110
|
execSync(
|
|
111
|
-
`curl -L -o C:/tmp/aptos.zip ${url} & powershell Expand-Archive -Path C:/tmp/aptos.zip -DestinationPath C:/tmp -Force & move C:\\tmp\\aptos.exe ${path}`,
|
|
111
|
+
`curl -L -o C:/tmp/aptos.zip ${url} & powershell Expand-Archive -Path C:/tmp/aptos.zip -DestinationPath C:/tmp -Force & move C:\\tmp\\aptos.exe ${path}.exe`,
|
|
112
112
|
);
|
|
113
113
|
} else if (os === "MacOS") {
|
|
114
114
|
// Install the CLI with brew.
|
|
@@ -126,6 +126,7 @@ const main = async () => {
|
|
|
126
126
|
// Spawn a child process to execute the binary with the provided arguments.
|
|
127
127
|
spawn(path, process.argv.slice(2), {
|
|
128
128
|
stdio: "inherit",
|
|
129
|
+
shell:true
|
|
129
130
|
});
|
|
130
131
|
};
|
|
131
132
|
|