Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .ci/esy-build-steps.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
---
# Cross-platform set of build steps for building esy projects

steps:
- task: NodeTool@0
inputs:
versionSpec: '8.9'
- script: npm i -g esy
versionSpec: '18.16.0'
- bash: |
NPM_CACHE_DIR=$(npm config get cache)
ESY_BASH_VERSION=$(node -e 'console.log(require("./package.json").version)')
echo "##vso[task.setvariable variable=NPM_CACHE_DIR]$NPM_CACHE_DIR"
echo "##vso[task.setvariable variable=ESY_BASH_VERSION]$ESY_BASH_VERSION"
displayName: Compute pipeline variables
- task: Cache@2
inputs:
key: 'npm | "$(Build.SourcesDirectory)/package-lock.json"'
restoreKeys: |
npm
path: $(NPM_CACHE_DIR)
displayName: Cache NPM

- script: npm install
- script: npm run build-exe
- script: npm run build-cygwin
displayName: 'Build cygwin'
# - script: npm run test-exe # Skipped because inline tests dont work on Windows without sys/time.h
- script: npm run test
displayName: "npm run test: before packing"
- script: npm run package-cygwin
displayName: "Package cygwin"
- bash: npm pack
displayName: "npm pack"
- task: PublishBuildArtifacts@1
displayName: 'Release Package'
inputs:
PathtoPublish: './esy-bash-0.3.20.tgz'
ArtifactName: npm-package
PathtoPublish: './esy-bash-$(ESY_BASH_VERSION).tgz'
ArtifactName: esy-bash-$(ESY_BASH_VERSION)
- script: node postinstall.js
displayName: "node postinstall.js (iteration 1)"
- script: npm run test
displayName: "npm run test: after unpack (iteration 1)"
# - script: node postinstall.js
# displayName: "node postinstall.js (iteration 2)"
# - script: npm run test
# displayName: "npm run test: after unpack (iteration 2)"
# - script: node postinstall.js
# displayName: "node postinstall.js (iteration 3)"
# - script: npm run test
# displayName: "npm run test: after unpack (iteration 3)"

# TODO Figure e2e test
184 changes: 0 additions & 184 deletions __tests__/esy-bash-tests.js

This file was deleted.

30 changes: 25 additions & 5 deletions build-cygwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,36 @@ const install = async () => {
path.join(__dirname, ".cygwin", "etc", "nsswitch.conf"),
"\ndb_home: /usr/esy\n"
);
console.log("Successfully updated nsswitch.conf");
} catch(e) {
console.error("Something went wrong while updating nsswitch.conf");
}

// Run a command to test it out & create initial script files
cp.spawnSync(path.join(__dirname, "re", "_build", "default", "bin", "EsyBash.exe"), ["bash", "-lc", "cd ~ && pwd"]);
console.log("Run a command to test it out & create initial script files");
let { signal, status, error } = cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash"), [
"-lc",
"cd ~ && pwd",
], { stdio: 'inherit' });

if (status !== 0) {
if (status !== null) {
console.error("Initial bash command got killed with status", status);
}
if (signal) {
console.error("Initial bash command got killed by signal", signal);
}
if (error) {
console.log("Initial bash command got killed because of the error", error);
}
}

console.log("Verifying esy profile set up...");
const bashRcContents = fs.readFileSync(path.join(__dirname, ".cygwin", "usr", "esy", ".bashrc")).toString("utf8");
console.log("Esy user profile setup!");
try {
console.log("Verifying esy profile set up...");
const bashRcContents = fs.readFileSync(path.join(__dirname, ".cygwin", "usr", "esy", ".bashrc")).toString("utf8");
console.log("Esy user profile setup! Found the following at /usr/esy/.bashrc", bashRcContents);
} catch(e) {
console.error("Something went wrong while reading /usr/esy/.bashrc", e);
}
}

if (os.platform() === "win32") {
Expand Down
7 changes: 0 additions & 7 deletions jest.config.js

This file was deleted.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"node": ">=8.0"
},
"files": [
"re/_build/default/bin/EsyBash.exe",
"bash-exec.js",
"postinstall.js",
"bin/esy-bash.js",
Expand All @@ -19,11 +18,8 @@
],
"scripts": {
"build-cygwin": "node build-cygwin.js",
"build-exe": "cd re && esy",
"package-cygwin": "node package-cygwin.js",
"postinstall": "node postinstall.js",
"test": "jest",
"test-exe": "cd re && esy test"
"postinstall": "node postinstall.js"
},
"repository": {
"type": "git",
Expand Down
8 changes: 0 additions & 8 deletions re/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions re/appveyor.yml

This file was deleted.

26 changes: 0 additions & 26 deletions re/bin/EsyBash.re

This file was deleted.

4 changes: 0 additions & 4 deletions re/bin/dune

This file was deleted.

1 change: 0 additions & 1 deletion re/dune-project

This file was deleted.

Empty file removed re/esy-bash.opam
Empty file.
Loading