Skip to content

Instantly share code, notes, and snippets.

View jeremycastelli's full-sized avatar

Castelli Jeremy jeremycastelli

View GitHub Profile
@jeremycastelli
jeremycastelli / Storage.ts
Created October 27, 2020 10:42
vuex persist capacitor SQLite storage
import { Plugins } from '@capacitor/core';
import 'capacitor-data-storage-sqlite';
export function useStorage(options: any = {}) {
const { CapacitorDataStorageSqlite } = Plugins;
const storage: any = CapacitorDataStorageSqlite;
let opened = false;
const openStorage = async (): Promise<boolean> => {
@jeremycastelli
jeremycastelli / script.js
Last active June 28, 2022 09:27
capacitor update Android and iOS app version script
const replace = require('replace');
/**
* Update version and versionCode in capacitor Android and iOS
*/
const appVersion = require("./package.json").version;
const appVersionSplitted = appVersion.split('.');
const appVersionCode = appVersionSplitted[0] * 100000 + appVersionSplitted[1] * 1000 + appVersionSplitted[2] * 10
// Android