Skip to content

Commit

Permalink
Fix npm script for windows (jfrog#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Oct 5, 2023
1 parent eb0719e commit 68ab299
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 25 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/scriptTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,24 @@ jobs:
restore-keys: ${{ runner.os }}-go-

- name: Test install CLI - jf
run: sh build/installcli/jf.sh && jf --version
run: |
sh build/installcli/jf.sh
jf --version
- name: Test install CLI - jfrog
run: sh build/installcli/jfrog.sh && jfrog --version
run: |
sh build/installcli/jfrog.sh
jfrog --version
- name: Test get CLI - jf
run: sh build/getcli/jf.sh && ./jf --version
run: |
sh build/getcli/jf.sh
./jf --version
- name: Test get CLI - jfrog
run: sh build/getcli/jfrog.sh && ./jfrog --version
run: |
sh build/getcli/jfrog.sh
./jfrog --version
- name: Test Build CLI - sh
run: |
Expand All @@ -64,23 +72,14 @@ jobs:
./jf${{ matrix.suite.osSuffix }} --version
if: ${{ matrix.suite.os == 'windows' }}

- name: Check if package.json build files changed
id: npm-changed-files
uses: tj-actions/changed-files@v39
with:
files: build/npm/*/package.json

- name: Test install npm - v2
working-directory: build/npm/v2
run: |
npm install
bin/jfrog${{ matrix.suite.osSuffix }} --version
if: steps.npm-changed-files.outputs.any_changed == 'false'
./bin/jfrog${{ matrix.suite.osSuffix }} --version
- name: Test install npm - v2-jf
working-directory: build/npm/v2-jf
run: |
npm install
bin/jf${{ matrix.suite.osSuffix }} --version
if: steps.npm-changed-files.outputs.any_changed == 'false'

./bin/jf${{ matrix.suite.osSuffix }} --version
File renamed without changes.
8 changes: 4 additions & 4 deletions build/npm/v2-jf/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function downloadWithProxy(myUrl) {
method: "CONNECT",
path: myUrlParts.hostname + ":443",
})
.on("connect", function (res, socket, head) {
.on("connect", function (res, socket, _) {
get(
{
host: myUrlParts.hostname,
Expand Down Expand Up @@ -110,12 +110,12 @@ function writeToFile(response) {
.on("end", function () {
file.end();
if (!process.platform.startsWith("win")) {
chmodSync(filePath, 755);
chmodSync(filePath, '755');
}
})
.on("error", function (err) {
console.error(err);
});
});
}

function getArchitecture() {
Expand Down Expand Up @@ -153,4 +153,4 @@ function getFileName() {
executable += ".exe";
}
return executable;
}
}
1 change: 0 additions & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
8 changes: 4 additions & 4 deletions build/npm/v2/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function downloadWithProxy(myUrl) {
method: "CONNECT",
path: myUrlParts.hostname + ":443",
})
.on("connect", function (res, socket, head) {
.on("connect", function (res, socket, _) {
get(
{
host: myUrlParts.hostname,
Expand Down Expand Up @@ -110,12 +110,12 @@ function writeToFile(response) {
.on("end", function () {
file.end();
if (!process.platform.startsWith("win")) {
chmodSync(filePath, 755);
chmodSync(filePath, '755');
}
})
.on("error", function (err) {
console.error(err);
});
});
}

function getArchitecture() {
Expand Down Expand Up @@ -153,4 +153,4 @@ function getFileName() {
executable += ".exe";
}
return executable;
}
}
1 change: 0 additions & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68ab299

Please sign in to comment.