Skip to content

Commit

Permalink
fix: update deploy script (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
tompsota authored Nov 18, 2024
1 parent f4b5b29 commit 56e6eb8
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ jobs:
shell: bash

- name: Compile .ts files
run: npx tsc
run: npm run tsc
shell: bash


- name: Configure git
run: |
git config user.name "${GITHUB_ACTOR}"
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.0.1] - 2024-11-18

- Android SDK version: 12.0.0
- iOS SDK version: 6.6.3

### Cordova

#### Fixed

- Removed conflicting export on npmjs

## [7.0.0] - 2024-11-15

- Android SDK version: 12.0.0
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-talsec-plugin-freerasp",
"version": "7.0.0",
"version": "7.0.1",
"description": "Cordova plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
"cordova": {
"id": "cordova-talsec-plugin-freerasp",
Expand All @@ -12,7 +12,8 @@
"scripts": {
"eslint": "eslint . --ext ts",
"prettier": "prettier \"**/*.{ts,js,html,css}\"",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"tsc": "tsc && node scripts/remove-export.js && prettier --write www/talsec.*"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-talsec-plugin-freerasp"
version="7.0.0">
version="7.0.1">

<name>freerasp</name>
<author>Talsec (info@talsec.app)</author>
Expand Down
35 changes: 35 additions & 0 deletions scripts/remove-export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');

// Function to remove `export {};` from the second-to-last line
const removeExportStatement = (filePath) => {
try {
// Read the file content
const fileContent = fs.readFileSync(filePath, 'utf8');

// Split the file into lines
const lines = fileContent.split('\n');

// Identify the second-to-last line
const secondToLastLineIndex = lines.length - 2;

// Check if the second-to-last line is `export {};`
if (lines[secondToLastLineIndex].trim() !== 'export {};') {
console.log(
`No 'export {};' found on the second-to-last line in ${filePath}`,
);
return;
}
lines.splice(secondToLastLineIndex, 1); // Remove the second-to-last line
const updatedContent = lines.join('\n');

// Write the updated content back to the file
fs.writeFileSync(filePath, updatedContent, 'utf8');
console.log(`Removed 'export {};' from the file.`);
} catch (error) {
console.error(`Error processing the file: ${error.message}`);
}
};

const filePath = path.resolve(__dirname, '../www/talsec.js');
removeExportStatement(filePath);

0 comments on commit 56e6eb8

Please sign in to comment.