Skip to content

Commit

Permalink
release alpha version & fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sikiryl committed Oct 16, 2020
1 parent 9cb41d5 commit c9a927f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
!jest.config.js
node_modules
dist/
bin/
manifests/
__snapshots__/
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
RELEASE_VERSION = 1.0.0-alpha
TARGET_PATH = bin/target/
BUNDLE_PATH = bin/bundle/

define bundleProject
ncc build bin/main.js -o $(BUNDLE_PATH)
endef

buildWindows:
$(call bundleProject)
pkg $(BUNDLE_PATH)index.js --output $(TARGET_PATH)levis-win --targets node14-win-x64
mv $(TARGET_PATH)levis-win.exe $(TARGET_PATH)levis.exe
cd $(TARGET_PATH) && zip levis-$(RELEASE_VERSION)-win-x64.zip levis.exe
rm -rf $(TARGET_PATH)levis.exe

buildMacOS:
$(call bundleProject)
pkg $(BUNDLE_PATH)index.js --output $(TARGET_PATH)levis-macos --targets node14-macos-x64
mv $(TARGET_PATH)levis-macos $(TARGET_PATH)levis
cd $(TARGET_PATH) && tar -zcvf levis-$(RELEASE_VERSION)-macos-x64.tar.gz levis
rm -rf $(TARGET_PATH)levis

buildLinux:
$(call bundleProject)
pkg $(BUNDLE_PATH)index.js --output $(TARGET_PATH)levis-linux --targets node14-linux-x64
mv $(TARGET_PATH)levis-linux $(TARGET_PATH)levis
cd $(TARGET_PATH) && tar -zcvf levis-$(RELEASE_VERSION)-linux-x64.tar.gz levis
rm -rf $(TARGET_PATH)levis

compile:
yarn run build-all

build: buildWindows buildMacOS buildLinux

clean:
rm -rf $(BUNDLE_PATH)
rm -rf $(TARGET_PATH)

all: clean compile buildWindows buildMacOS buildLinux
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "levis",
"version": "1.0.0",
"version": "1.0.0-alpha",
"main": "main.js",
"types": "main.ts",
"license": "Apache-2.0",
"license": "MIT",
"private": true,
"scripts": {
"import": "cdk8s import",
Expand Down
12 changes: 3 additions & 9 deletions src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ export class FileUtils {
Fs.rmdirSync(newPath, { recursive: true });
}
Fs.mkdirSync(newPath, { recursive: true });
Fs.rename(oldPath, newPath, (error) => {
if(error) {
log.error(error);
process.exit(1);
}
Fs.rmdirSync(oldPath, { recursive: true });
log.info("Successfully moved %s to %s.", oldPath, newPath);
}
);
Fs.renameSync(oldPath, newPath);
Fs.rmdirSync(oldPath, { recursive: true });
log.info("Successfully moved %s to %s.", oldPath, newPath);
}
}

0 comments on commit c9a927f

Please sign in to comment.